Skip to content

Commit 21230b3

Browse files
author
Ayane Satomi
authored
Merge branch 'master' into sr229/travis-arm
2 parents 3a675f6 + f133b00 commit 21230b3

28 files changed

+1146
-1345
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
node_modules
22
build
33
release
4+
binaries
5+
source

.travis.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ services:
66

77
before_install:
88
- export MAJOR_VERSION="2"
9-
- export VSCODE_VERSION="1.38.1"
9+
- export VSCODE_VERSION="1.39.2"
1010
- export VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER"
11-
- export TAG="$VERSION-vsc$VSCODE_VERSION"
11+
- export TAG="$VERSION-vsc$VSCODE_VERSION-$(uname -m)"
1212
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then export MINIFY="true"; fi
1313
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then export PACKAGE="true"; fi
1414

1515
# Don't build on tags because we'll already have built the commit.
1616
jobs:
1717
include:
18-
- name: "Linux build - x86"
18+
- name: "Linux build - x86_64"
1919
os: linux
2020
arch: amd64
2121
dist: trusty
2222
env: TARGET="linux"
2323
if: tag IS blank
2424
script: scripts/ci.bash
25-
- name: "Alpine build - x86"
25+
- name: "Alpine build - x86_64"
2626
os: linux
2727
arch: amd64
2828
dist: trusty
@@ -46,8 +46,8 @@ jobs:
4646
- name: "MacOS build"
4747
os: osx
4848
if: tag IS blank
49-
script: travis_wait 30 scripts/ci.bash
50-
- name: "Docker build - x86"
49+
script: travis_wait 40 scripts/ci.bash
50+
- name: "Docker build - x86_64"
5151
os: linux
5252
dist: trusty
5353
arch: amd64
@@ -99,6 +99,5 @@ deploy:
9999

100100
cache:
101101
yarn: true
102-
timeout: 1000
103102
directories:
104-
- .cache
103+
- source

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ COPY . .
1717
RUN yarn \
1818
&& MINIFY=true GITHUB_TOKEN="${githubToken}" yarn build "${vscodeVersion}" "${codeServerVersion}" \
1919
&& yarn binary "${vscodeVersion}" "${codeServerVersion}" \
20-
&& mv "/src/build/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x86_64-built/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x86_64" /src/build/code-server \
21-
&& rm -r /src/build/vscode-* \
22-
&& rm -r /src/build/code-server*-linux-*
20+
&& mv "/src/binaries/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x86_64" /src/binaries/code-server \
21+
&& rm -r /src/build \
22+
&& rm -r /src/source
2323

2424
# We deploy with ubuntu so that devs have a familiar environment.
2525
FROM ubuntu:18.04
@@ -54,7 +54,7 @@ WORKDIR /home/coder/project
5454
# mount. So that they do not lose their data if they delete the container.
5555
VOLUME [ "/home/coder/project" ]
5656

57-
COPY --from=0 /src/build/code-server /usr/local/bin/code-server
57+
COPY --from=0 /src/binaries/code-server /usr/local/bin/code-server
5858
EXPOSE 8080
5959

6060
ENTRYPOINT ["dumb-init", "code-server", "--host", "0.0.0.0"]

README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,13 @@ arguments when launching code-server with Docker. See
5858

5959
### Build
6060

61-
- If you also plan on developing, set the `OUT` environment variable. Otherwise
62-
it will build in this directory which will cause issues because `yarn watch`
63-
will try to compile the build directory as well.
64-
- Run `yarn build ${vscodeVersion} ${codeServerVersion}` in this directory (for
65-
example: `yarn build 1.36.0 development`).
66-
- If you target the same VS Code version our Travis builds do everything will
67-
work but if you target some other version it might not (we have to do some
68-
patching to VS Code so different versions aren't always compatible).
69-
- You can run the built code with `node path/to/build/out/vs/server/main.js` or run
70-
`yarn binary` with the same arguments in the previous step to package the
71-
code into a single binary.
61+
```shell
62+
export OUT=/path/to/output/build # Optional if only building. Required if also developing.
63+
yarn build ${vscodeVersion} ${codeServerVersion} # See travis.yml for the VS Code version to use.
64+
# The code-server version can be anything you want.
65+
node ~/path/to/output/build/out/vs/server/main.js # You can run the built JavaScript with Node.
66+
yarn binary ${vscodeVersion} ${codeServerVersion} # Or you can package it into a binary.
67+
```
7268

7369
## Known Issues
7470

@@ -109,11 +105,12 @@ data collected to improve code-server.
109105
```shell
110106
git clone https://github.com/microsoft/vscode
111107
cd vscode
112-
git checkout <see travis.yml for the VS Code version to use here>
108+
git checkout ${vscodeVersion} # See travis.yml for the version to use.
109+
yarn
113110
git clone https://github.com/cdr/code-server src/vs/server
114111
cd src/vs/server
115-
yarn patch:apply
116112
yarn
113+
yarn patch:apply
117114
yarn watch
118115
# Wait for the initial compilation to complete (it will say "Finished compilation").
119116
# Run the next command in another shell.

package.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
{
22
"license": "MIT",
33
"scripts": {
4-
"ensure-in-vscode": "bash ./scripts/tasks.bash ensure-in-vscode",
5-
"preinstall": "yarn ensure-in-vscode && cd ../../../ && yarn || true",
6-
"postinstall": "rm -rf node_modules/@types/node",
7-
"start": "yarn ensure-in-vscode && nodemon --watch ../../../out --verbose ../../../out/vs/server/main.js",
8-
"watch": "yarn ensure-in-vscode && cd ../../../ && yarn watch",
9-
"build": "bash ./scripts/tasks.bash build",
10-
"package": "bash ./scripts/tasks.bash package",
11-
"package-prebuilt": "bash ./scripts/tasks.bash package-prebuilt",
12-
"binary": "bash ./scripts/tasks.bash binary",
13-
"patch:generate": "yarn ensure-in-vscode && cd ../../../ && git diff --staged > ./src/vs/server/scripts/vscode.patch",
14-
"patch:apply": "yarn ensure-in-vscode && cd ../../../ && git apply ./src/vs/server/scripts/vscode.patch"
4+
"runner": "cd ./scripts && node --max-old-space-size=32384 -r ts-node/register ./build.ts",
5+
"start": "nodemon --watch ../../../out --verbose ../../../out/vs/server/main.js",
6+
"watch": "cd ../../../ && yarn watch",
7+
"build": "yarn && yarn runner build",
8+
"package": "yarn runner package",
9+
"binary": "yarn runner binary",
10+
"patch:generate": "cd ../../../ && git diff --staged > ./src/vs/server/scripts/vscode.patch",
11+
"patch:apply": "cd ../../../ && git apply ./src/vs/server/scripts/vscode.patch"
1512
},
1613
"devDependencies": {
1714
"@coder/nbin": "^1.2.2",
15+
"@types/fs-extra": "^8.0.1",
16+
"@types/node": "^10.12.12",
1817
"@types/pem": "^1.9.5",
1918
"@types/safe-compare": "^1.1.0",
2019
"@types/tar-fs": "^1.16.1",
2120
"@types/tar-stream": "^1.6.1",
22-
"nodemon": "^1.19.1"
21+
"fs-extra": "^8.1.0",
22+
"nodemon": "^1.19.1",
23+
"ts-node": "^8.4.1",
24+
"typescript": "3.6"
2325
},
2426
"resolutions": {
2527
"@types/node": "^10.12.12",
2628
"safe-buffer": "^5.1.1"
2729
},
2830
"dependencies": {
2931
"@coder/logger": "^1.1.8",
30-
"@coder/node-browser": "^1.0.5",
32+
"@coder/node-browser": "^1.0.6",
3133
"@coder/requirefs": "^1.0.6",
3234
"httpolyglot": "^0.1.2",
3335
"pem": "^1.14.2",

scripts/build-json.js

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)