Skip to content

Commit 590f699

Browse files
committed
Allow specifying the target
You still must build on the target system though because of the native Node modules.
1 parent dde683d commit 590f699

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

scripts/ci.bash

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set -euo pipefail
33

44
# Build using a Docker container.
55
function docker-build() {
6+
local target="${TARGET:-}"
67
local image="codercom/nbin-${target}"
78
if [[ "${target}" == "linux" ]] ; then
89
image="codercom/nbin-centos"
@@ -23,7 +24,7 @@ function docker-build() {
2324

2425
function docker-exec() {
2526
local command="${1}" ; shift
26-
local args="'${vscodeVersion}' '${codeServerVersion}'"
27+
local args="'${vscodeVersion}' '${codeServerVersion}' '${target}'"
2728
docker exec "${containerId}" \
2829
bash -c "cd /src && CI=true yarn ${command} ${args}"
2930
}
@@ -54,7 +55,6 @@ function main() {
5455
local codeServerVersion="${VERSION:-}"
5556
local vscodeVersion="${VSCODE_VERSION:-}"
5657
local ostype="${OSTYPE:-}"
57-
local target="${TARGET:-}"
5858

5959
if [[ -z "${codeServerVersion}" ]] ; then
6060
>&2 echo "Must set VERSION environment variable"; exit 1
@@ -65,7 +65,6 @@ function main() {
6565
fi
6666

6767
if [[ "${ostype}" == "darwin"* ]]; then
68-
target=darwin
6968
local-build
7069
else
7170
docker-build

scripts/tasks.bash

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,20 @@ function main() {
240240
exit 0
241241
fi
242242

243+
local codeServerVersion="${1}" ; shift
243244
local ci="${CI:-}"
244245
local minify="${MINIFY:-}"
245-
local arch="x86_64"
246-
local target="linux"
247-
local ostype="${OSTYPE:-}"
248-
if [[ "${ostype}" == "darwin"* ]] ; then
249-
target="darwin"
250-
else
251-
arch=$(uname -m)
246+
local arch
247+
arch=$(uname -m)
248+
local target="${1:-}"
249+
if [[ -z "${target}" ]] ; then
250+
local ostype="${OSTYPE:-}"
251+
if [[ "${ostype}" == "darwin"* ]] ; then
252+
target="darwin"
253+
else
254+
target="linux"
255+
fi
252256
fi
253-
254-
local codeServerVersion="${1}" ; shift
255257
local binaryName="code-server${codeServerVersion}-vsc${vscodeVersion}-${target}-${arch}"
256258
local buildPath="${stagingPath}/${binaryName}-built"
257259

0 commit comments

Comments
 (0)