From 9035bfa871669a5ff8ab9e3ab4ae485d2d57c26f Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Tue, 6 Oct 2020 14:19:04 -0400 Subject: [PATCH] Add coder cloud agent binary to build process --- ci/build/build-code-server.sh | 6 ++++++ ci/build/build-release.sh | 1 + ci/build/clean.sh | 3 ++- ci/dev/image/run.sh | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ci/build/build-code-server.sh b/ci/build/build-code-server.sh index df085280..0aff035a 100755 --- a/ci/build/build-code-server.sh +++ b/ci/build/build-code-server.sh @@ -18,6 +18,12 @@ main() { chmod +x out/node/entry.js fi + if ! [ -f ./lib/coder-cloud-agent ]; then + OS="$(uname | tr '[:upper:]' '[:lower:]')" + curl -fsSL "https://storage.googleapis.com/coder-cloud-releases/agent/latest/$OS/cloud-agent" -o ./lib/coder-cloud-agent + chmod +x ./lib/coder-cloud-agent + fi + parcel build \ --public-url "." \ --out-dir dist \ diff --git a/ci/build/build-release.sh b/ci/build/build-release.sh index 8d8d1c90..88d3fe61 100755 --- a/ci/build/build-release.sh +++ b/ci/build/build-release.sh @@ -25,6 +25,7 @@ main() { rsync README.md "$RELEASE_PATH" rsync LICENSE.txt "$RELEASE_PATH" rsync ./lib/vscode/ThirdPartyNotices.txt "$RELEASE_PATH" + rsync ./lib/coder-cloud-agent "$RELEASE_PATH/lib" # code-server exports types which can be imported and used by plugins. Those # types import ipc.d.ts but it isn't included in the final vscode build so diff --git a/ci/build/clean.sh b/ci/build/clean.sh index 7a83a284..52d123c9 100755 --- a/ci/build/clean.sh +++ b/ci/build/clean.sh @@ -15,7 +15,8 @@ main() { dist \ .cache \ node-* \ - .home + .home \ + lib/coder-cloud-agent pushd lib/vscode git clean -xffd diff --git a/ci/dev/image/run.sh b/ci/dev/image/run.sh index 08391581..0557f1b2 100755 --- a/ci/dev/image/run.sh +++ b/ci/dev/image/run.sh @@ -12,6 +12,7 @@ main() { -v "$PWD:/src" \ -e HOME="/src/.home" \ -e USER="coder" \ + -e GITHUB_TOKEN \ -w /src \ -p 127.0.0.1:8080:8080 \ -u "$(id -u):$(id -g)" \