From 590f6996873589aafb73f5623337bb2f25bd6e5e Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 5 Aug 2019 11:03:47 -0500 Subject: [PATCH] Allow specifying the target You still must build on the target system though because of the native Node modules. --- scripts/ci.bash | 5 ++--- scripts/tasks.bash | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/scripts/ci.bash b/scripts/ci.bash index 5c94137c..6c88e8d3 100755 --- a/scripts/ci.bash +++ b/scripts/ci.bash @@ -3,6 +3,7 @@ set -euo pipefail # Build using a Docker container. function docker-build() { + local target="${TARGET:-}" local image="codercom/nbin-${target}" if [[ "${target}" == "linux" ]] ; then image="codercom/nbin-centos" @@ -23,7 +24,7 @@ function docker-build() { function docker-exec() { local command="${1}" ; shift - local args="'${vscodeVersion}' '${codeServerVersion}'" + local args="'${vscodeVersion}' '${codeServerVersion}' '${target}'" docker exec "${containerId}" \ bash -c "cd /src && CI=true yarn ${command} ${args}" } @@ -54,7 +55,6 @@ function main() { local codeServerVersion="${VERSION:-}" local vscodeVersion="${VSCODE_VERSION:-}" local ostype="${OSTYPE:-}" - local target="${TARGET:-}" if [[ -z "${codeServerVersion}" ]] ; then >&2 echo "Must set VERSION environment variable"; exit 1 @@ -65,7 +65,6 @@ function main() { fi if [[ "${ostype}" == "darwin"* ]]; then - target=darwin local-build else docker-build diff --git a/scripts/tasks.bash b/scripts/tasks.bash index 68edf764..93ad3526 100755 --- a/scripts/tasks.bash +++ b/scripts/tasks.bash @@ -240,18 +240,20 @@ function main() { exit 0 fi + local codeServerVersion="${1}" ; shift local ci="${CI:-}" local minify="${MINIFY:-}" - local arch="x86_64" - local target="linux" - local ostype="${OSTYPE:-}" - if [[ "${ostype}" == "darwin"* ]] ; then - target="darwin" - else - arch=$(uname -m) + local arch + arch=$(uname -m) + local target="${1:-}" + if [[ -z "${target}" ]] ; then + local ostype="${OSTYPE:-}" + if [[ "${ostype}" == "darwin"* ]] ; then + target="darwin" + else + target="linux" + fi fi - - local codeServerVersion="${1}" ; shift local binaryName="code-server${codeServerVersion}-vsc${vscodeVersion}-${target}-${arch}" local buildPath="${stagingPath}/${binaryName}-built"