Skip to content

Commit

Permalink
Fix Travis build script
Browse files Browse the repository at this point in the history
  • Loading branch information
code-asher committed Jun 20, 2019
1 parent 9af553e commit 35c9fd1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ before_install:
libsecret-1-dev; fi
- npm install -g [email protected]
script:
- scripts/build.sh
- scripts/build.bash
before_deploy:
- echo "$VERSION" "$TRAVIS_COMMIT"
- git config --local user.name "$USER_NAME"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"postinstall": "yarn build:rules",
"build": "yarn task build",
"bundle": "yarn task bundle",
"package": "yarn task package",
"start": "npm-run-all --parallel watch build:run",
"watch": "yarn task build true",
"build:run": "cd ./out && node ./packages/server/src/cli # TODO: restart on change",
Expand Down
13 changes: 8 additions & 5 deletions scripts/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ function docker_build() {
docker cp ./. "${containerId}":/src
docker_exec "cd /src && yarn"
docker_exec "cd /src && npm rebuild"
docker_exec "cd /src && NODE_ENV=production VERSION=${version} yarn task build:server:binary"
docker_exec "cd /src && yarn task package ${version}"
docker_exec "cd /src && NODE_ENV=production VERSION=${version} yarn build"
docker_exec "cd /src && yarn bundle"
docker_exec "cd /src && yarn package ${version}"
docker cp "${containerId}":/src/release/. ./release/

docker stop "${containerId}"
Expand All @@ -28,18 +29,20 @@ function docker_build() {
function main() {
local version=${VERSION:-}
local ostype=${OSTYPE:-}
local target=${TARGET:-}

if [[ -z "${version}" ]] ; then
>&2 echo "Must set VERSION environment variable"
exit 1
fi

if [[ "${ostype}" == "darwin"* ]]; then
NODE_ENV=production VERSION="${version}" yarn task build:server:binary
yarn task package "${version}"
NODE_ENV=production VERSION="${version}" yarn build
yarn bundle
yarn package "${version}"
else
local image
if [[ "$TARGET" == "alpine" ]]; then
if [[ "${target}" == "alpine" ]]; then
image="codercom/nbin-alpine"
else
image="codercom/nbin-centos"
Expand Down
9 changes: 7 additions & 2 deletions scripts/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,13 @@ const ensureInstalled = register("vscode:install", async (runner, logger) => {
}));
break;
case 404:
logger.info(`VS Code ${vscodeVersion} hasn't been packaged yet`);
clone().then(() => build()).catch(reject);
const message = `VS Code ${vscodeVersion} hasn't been packaged yet`;
if (!process.env.CI) {
logger.warn(message);
clone().then(() => build()).catch(reject);
} else {
reject(new Error(message));
}
break;
default:
return reject(new Error(res.statusMessage));
Expand Down

0 comments on commit 35c9fd1

Please sign in to comment.