2020-05-08 11:48:49 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2022-02-05 06:52:42 +08:00
|
|
|
# This is due to an upstream issue with RHEL7/CentOS 7 comptability with node-argon2
|
|
|
|
# See: https://github.com/cdr/code-server/pull/3422#pullrequestreview-677765057
|
|
|
|
export npm_config_build_from_source=true
|
|
|
|
|
2020-05-08 11:48:49 +08:00
|
|
|
main() {
|
|
|
|
cd "$(dirname "${0}")/../.."
|
2021-09-09 03:05:49 +08:00
|
|
|
|
2020-05-16 22:55:46 +08:00
|
|
|
source ./ci/lib.sh
|
2020-05-08 11:48:49 +08:00
|
|
|
|
2022-12-08 06:04:50 +08:00
|
|
|
rsync --exclude yarn.lock "$RELEASE_PATH/" "$RELEASE_PATH-standalone"
|
2020-05-28 04:39:17 +08:00
|
|
|
RELEASE_PATH+=-standalone
|
2020-05-08 11:48:49 +08:00
|
|
|
|
|
|
|
# We cannot find the path to node from $PATH because yarn shims a script to ensure
|
|
|
|
# we use the same version it's using so we instead run a script with yarn that
|
|
|
|
# will print the path to node.
|
|
|
|
local node_path
|
2021-06-29 00:36:55 +08:00
|
|
|
node_path="$(yarn -s node <<< 'console.info(process.execPath)')"
|
2020-05-08 11:48:49 +08:00
|
|
|
|
|
|
|
mkdir -p "$RELEASE_PATH/bin"
|
2021-09-09 03:05:49 +08:00
|
|
|
mkdir -p "$RELEASE_PATH/lib"
|
2020-05-08 11:48:49 +08:00
|
|
|
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
|
2020-05-22 07:18:50 +08:00
|
|
|
rsync "$node_path" "$RELEASE_PATH/lib/node"
|
2020-05-08 11:48:49 +08:00
|
|
|
|
2022-08-05 00:03:28 +08:00
|
|
|
pushd "$RELEASE_PATH"
|
2022-09-07 02:03:27 +08:00
|
|
|
npm install --unsafe-perm --omit=dev
|
2022-08-05 00:03:28 +08:00
|
|
|
popd
|
2020-05-08 11:48:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|