diff --git a/.dockerignore b/.dockerignore index 9e9cdcf66bd6..85fc075187c6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,15 @@ +.git +.gitignore Dockerfile +lib +node_modules +**/dist +**/out +.DS_Store +*.DS_Store +release +**/yarn-error.log +**/node_modules # Docs doc/ # GitHub stuff diff --git a/.gitignore b/.gitignore index 9ced34fb847c..202a32645693 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ dist out .DS_Store release +yarn-error.log diff --git a/Dockerfile b/Dockerfile index fc2915677762..5f4897348007 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,32 @@ FROM node:8.15.0 -# Install VS Code's deps. These are the only two it seems we need. RUN apt-get update && apt-get install -y \ libxkbfile-dev \ libsecret-1-dev -# Ensure latest yarn. -RUN npm install -g yarn@1.13 - WORKDIR /src COPY . . -# In the future, we can use https://github.com/yarnpkg/rfcs/pull/53 to make yarn use the node_modules -# directly which should be fast as it is slow because it populates its own cache every time. -RUN yarn && yarn task build:server:binary +# This takes ages and always dies in the end. :( +# RUN yarn --frozen-lockfile && yarn task build:server:binary + +# Make the debugging easier - and the rebuilds faster +# and our life happier lets break up the build to sequential parts +RUN yarn --frozen-lockfile + +RUN yarn task vscode:install +RUN yarn task build:copy-vscode +RUN yarn task build:web +RUN yarn task build:bootstrap-fork +RUN yarn task build:default-extensions +RUN yarn task build:server:bundle +RUN yarn task build:app:browser +RUN yarn task build:server:binary:package # We deploy with ubuntu so that devs have a familiar environment. FROM ubuntu:18.10 WORKDIR /root/project + COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server EXPOSE 8443 diff --git a/package.json b/package.json index 4eca724eb6bd..e43e6a3046b6 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "description": "Run VS Code remotely.", "scripts": { "build:rules": "cd ./rules && tsc -p .", - "packages:install": "cd ./packages && yarn", - "postinstall": "npm-run-all --parallel packages:install build:rules", + "packages:install": "cd ./packages && yarn --frozen-lockfile", + "postinstall": "npm-run-all packages:install build:rules", "start": "cd ./packages/server && yarn start", "task": "ts-node -r tsconfig-paths/register build/tasks.ts", "test": "cd ./packages && yarn test" diff --git a/packages/vscode/package.json b/packages/vscode/package.json index df9c53c9b469..89a708fdc2dd 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -14,6 +14,7 @@ }, "devDependencies": { "@types/tar-stream": "^1.6.0", + "cross-env": "^5.2.0", "vscode-textmate": "^4.0.1" } } diff --git a/packages/vscode/yarn.lock b/packages/vscode/yarn.lock index ef3efe4088c5..92dde81420c4 100644 --- a/packages/vscode/yarn.lock +++ b/packages/vscode/yarn.lock @@ -46,6 +46,25 @@ bl@^3.0.0: dependencies: readable-stream "^3.0.1" +cross-env@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2" + integrity sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg== + dependencies: + cross-spawn "^6.0.5" + is-windows "^1.0.0" + +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" @@ -85,6 +104,16 @@ inherits@^2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= +is-windows@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -136,6 +165,11 @@ nan@^2.10.0, nan@^2.8.0: resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw== +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -157,6 +191,11 @@ oniguruma@^7.0.0: dependencies: nan "^2.10.0" +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -194,6 +233,23 @@ schema-utils@^0.4.5: ajv "^6.1.0" ajv-keywords "^3.1.0" +semver@^5.5.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + spdlog@^0.7.2: version "0.7.2" resolved "https://registry.yarnpkg.com/spdlog/-/spdlog-0.7.2.tgz#9298753d7694b9ee9bbfd7e01ea1e4c6ace1e64d" @@ -248,6 +304,13 @@ vscode-textmate@^4.0.1: dependencies: oniguruma "^7.0.0" +which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" diff --git a/scripts/install-packages.ts b/scripts/install-packages.ts index 9517c9c111fa..a27e1e2aa84a 100644 --- a/scripts/install-packages.ts +++ b/scripts/install-packages.ts @@ -11,7 +11,7 @@ const doInstall = (pkg: string, path: string): Promise => { logger.info(`Installing "${pkg}" dependencies...`); return new Promise((resolve): void => { - exec("yarn --network-concurrency 1", { + exec("yarn --frozen-lockfile --network-concurrency 1", { cwd: path, maxBuffer: 1024 * 1024 * 10, }, (error, stdout, stderr) => {