Skip to content

Commit daa1c86

Browse files
authored
Merge pull request #2086 from nhooyr/master
Integrate Coder Cloud Agent
2 parents 9f963c7 + 9002f11 commit daa1c86

File tree

19 files changed

+195
-78
lines changed

19 files changed

+195
-78
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
steps:
99
- uses: actions/checkout@v1
1010
- name: Run ./ci/steps/fmt.sh
11-
uses: ./ci/images/debian8
11+
uses: ./ci/images/debian10
1212
with:
1313
args: ./ci/steps/fmt.sh
1414

@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v1
1919
- name: Run ./ci/steps/lint.sh
20-
uses: ./ci/images/debian8
20+
uses: ./ci/images/debian10
2121
with:
2222
args: ./ci/steps/lint.sh
2323

@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727
- uses: actions/checkout@v1
2828
- name: Run ./ci/steps/test.sh
29-
uses: ./ci/images/debian8
29+
uses: ./ci/images/debian10
3030
with:
3131
args: ./ci/steps/test.sh
3232

@@ -35,7 +35,7 @@ jobs:
3535
steps:
3636
- uses: actions/checkout@v1
3737
- name: Run ./ci/steps/release.sh
38-
uses: ./ci/images/debian8
38+
uses: ./ci/images/debian10
3939
with:
4040
args: ./ci/steps/release.sh
4141
- name: Upload npm package artifact
@@ -116,7 +116,7 @@ jobs:
116116
name: release-packages
117117
path: ./release-packages
118118
- name: Run ./ci/steps/build-docker-image.sh
119-
uses: ./ci/images/debian8
119+
uses: ./ci/images/debian10
120120
with:
121121
args: ./ci/steps/build-docker-image.sh
122122
- name: Upload release image

.github/workflows/publish.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v1
1212
- name: Run ./ci/steps/publish-npm.sh
13-
uses: ./ci/images/debian8
13+
uses: ./ci/images/debian10
1414
with:
1515
args: ./ci/steps/publish-npm.sh
1616
env:
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v1
2424
- name: Run ./ci/steps/push-docker-manifest.sh
25-
uses: ./ci/images/debian8
25+
uses: ./ci/images/debian10
2626
with:
2727
args: ./ci/steps/push-docker-manifest.sh
2828
env:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ release-images/
1111
node_modules
1212
node-*
1313
/plugins
14+
/lib/coder-cloud-agent
15+
.home

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "lib/vscode"]
22
path = lib/vscode
33
url = https://github.com/microsoft/vscode
4+
ignore = dirty

ci/build/build-code-server.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ main() {
1818
chmod +x out/node/entry.js
1919
fi
2020

21+
if ! [ -f ./lib/coder-cloud-agent ]; then
22+
OS="$(uname | tr '[:upper:]' '[:lower:]')"
23+
curl -fsSL "https://storage.googleapis.com/coder-cloud-releases/agent/latest/$OS/cloud-agent" -o ./lib/coder-cloud-agent
24+
chmod +x ./lib/coder-cloud-agent
25+
fi
26+
2127
parcel build \
2228
--public-url "." \
2329
--out-dir dist \

ci/build/build-packages.sh

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@ main() {
1111
mkdir -p release-packages
1212

1313
release_archive
14-
# Will stop the auto update issues and allow people to upgrade their scripts
15-
# for the new release structure.
16-
if [[ $ARCH == "amd64" ]]; then
17-
if [[ $OS == "linux" ]]; then
18-
ARCH=x86_64 release_archive
19-
elif [[ $OS == "macos" ]]; then
20-
OS=darwin ARCH=x86_64 release_archive
21-
fi
22-
fi
2314

2415
if [[ $OS == "linux" ]]; then
2516
release_nfpm
@@ -30,12 +21,6 @@ release_archive() {
3021
local release_name="code-server-$VERSION-$OS-$ARCH"
3122
if [[ $OS == "linux" ]]; then
3223
tar -czf "release-packages/$release_name.tar.gz" --transform "s/^\.\/release-standalone/$release_name/" ./release-standalone
33-
elif [[ $OS == "darwin" && $ARCH == "x86_64" ]]; then
34-
# Just exists to make autoupdating from 3.2.0 work again.
35-
mv ./release-standalone "./$release_name"
36-
zip -r "release-packages/$release_name.zip" "./$release_name"
37-
mv "./$release_name" ./release-standalone
38-
return
3924
else
4025
tar -czf "release-packages/$release_name.tar.gz" -s "/^release-standalone/$release_name/" release-standalone
4126
fi

ci/build/build-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ main() {
2525
rsync README.md "$RELEASE_PATH"
2626
rsync LICENSE.txt "$RELEASE_PATH"
2727
rsync ./lib/vscode/ThirdPartyNotices.txt "$RELEASE_PATH"
28+
rsync ./lib/coder-cloud-agent "$RELEASE_PATH/lib"
2829

2930
# code-server exports types which can be imported and used by plugins. Those
3031
# types import ipc.d.ts but it isn't included in the final vscode build so
@@ -57,7 +58,6 @@ EOF
5758
rsync yarn.lock "$RELEASE_PATH"
5859
rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh"
5960

60-
6161
if [ "$KEEP_MODULES" = 1 ]; then
6262
rsync node_modules/ "$RELEASE_PATH/node_modules"
6363
fi

ci/build/clean.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,7 @@ main() {
55
cd "$(dirname "${0}")/../.."
66
source ./ci/lib.sh
77

8-
rm -rf \
9-
out \
10-
release \
11-
release-standalone \
12-
release-packages \
13-
release-gcp \
14-
release-images \
15-
dist \
16-
.cache \
17-
node-*
8+
git clean -Xffd
189

1910
pushd lib/vscode
2011
git clean -xffd

ci/dev/image/run.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@ set -euo pipefail
44
main() {
55
cd "$(dirname "$0")/../../.."
66
source ./ci/lib.sh
7+
mkdir -p .home
78

89
docker run \
910
-it \
1011
--rm \
1112
-v "$PWD:/src" \
13+
-e HOME="/src/.home" \
14+
-e USER="coder" \
15+
-e GITHUB_TOKEN \
16+
-e KEEP_MODULES \
17+
-e MINIFY \
1218
-w /src \
1319
-p 127.0.0.1:8080:8080 \
1420
-u "$(id -u):$(id -g)" \
1521
-e CI \
16-
"$(docker_build ./ci/images/debian8)" \
22+
"$(docker_build ./ci/images/"${IMAGE-debian10}")" \
1723
"$@"
1824
}
1925

ci/dev/lint.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ main() {
77
eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js")
88
stylelint $(git ls-files "*.css")
99
tsc --noEmit
10-
# See comment in ./ci/image/debian8
11-
if [[ ! ${CI-} ]]; then
12-
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh")
13-
fi
10+
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh")
1411
}
1512

1613
main "$@"

0 commit comments

Comments
 (0)