2020-05-08 05:48:49 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2021-06-07 23:09:54 +02: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
|
2021-06-07 23:46:59 +02:00
|
|
|
export npm_config_build_from_source=true
|
2021-06-07 23:09:54 +02:00
|
|
|
|
2020-05-08 05:48:49 +02:00
|
|
|
main() {
|
|
|
|
cd "$(dirname "${0}")/../.."
|
2020-05-16 16:55:46 +02:00
|
|
|
source ./ci/lib.sh
|
2020-05-08 05:48:49 +02:00
|
|
|
|
2020-05-27 22:39:17 +02:00
|
|
|
rsync "$RELEASE_PATH/" "$RELEASE_PATH-standalone"
|
|
|
|
RELEASE_PATH+=-standalone
|
2020-05-08 05:48:49 +02: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-28 18:36:55 +02:00
|
|
|
node_path="$(yarn -s node <<< 'console.info(process.execPath)')"
|
2020-05-08 05:48:49 +02:00
|
|
|
|
|
|
|
mkdir -p "$RELEASE_PATH/bin"
|
|
|
|
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
|
2020-05-22 01:18:50 +02:00
|
|
|
rsync "$node_path" "$RELEASE_PATH/lib/node"
|
2020-05-08 05:48:49 +02:00
|
|
|
|
2020-05-20 15:38:01 +02:00
|
|
|
ln -s "./bin/code-server" "$RELEASE_PATH/code-server"
|
|
|
|
ln -s "./lib/node" "$RELEASE_PATH/node"
|
|
|
|
|
2020-05-08 05:48:49 +02:00
|
|
|
cd "$RELEASE_PATH"
|
2020-05-15 03:47:33 +02:00
|
|
|
yarn --production --frozen-lockfile
|
2020-05-08 05:48:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|