2020-05-08 03:48:49 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
main() {
|
|
|
|
cd "$(dirname "${0}")/../.."
|
2020-05-16 14:55:46 +00:00
|
|
|
source ./ci/lib.sh
|
2020-05-08 03:48:49 +00:00
|
|
|
|
|
|
|
rsync "$RELEASE_PATH/" "$RELEASE_PATH-static"
|
|
|
|
RELEASE_PATH+=-static
|
|
|
|
|
|
|
|
# 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
|
|
|
|
node_path="$(yarn -s node <<< 'console.info(process.execPath)')"
|
|
|
|
|
|
|
|
mkdir -p "$RELEASE_PATH/bin"
|
|
|
|
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
|
2020-05-21 20:45:31 +00:00
|
|
|
|
|
|
|
g++ -Wl,--allow-multiple-definition "$node_path" -static-libstdc++ -static-libgcc -o "$RELEASE_PATH/lib/node"
|
2020-05-08 03:48:49 +00:00
|
|
|
|
2020-05-20 13:38:01 +00:00
|
|
|
ln -s "./bin/code-server" "$RELEASE_PATH/code-server"
|
|
|
|
ln -s "./lib/node" "$RELEASE_PATH/node"
|
|
|
|
|
2020-05-08 03:48:49 +00:00
|
|
|
cd "$RELEASE_PATH"
|
2020-05-15 01:47:33 +00:00
|
|
|
yarn --production --frozen-lockfile
|
2020-05-08 03:48:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|