Auto docker building and deploy in travis CI (#521)

* made spacing for travis yaml consistent in file

* cleaned up .travis.yml and moved some code into a script

* checking if i can get travis to build this

* travis

* fixed an if statement

* fixed travis.yml file

* replaced my name with codercom
This commit is contained in:
Luca Casonato 2019-09-17 18:53:25 +02:00 committed by Asher
parent a2ee6c8e73
commit b8c3d96fcd
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A

View File

@ -19,20 +19,28 @@ jobs:
dist: trusty
env: TARGET="linux"
if: tag IS blank
script: scripts/ci.bash
- name: "Alpine build"
os: linux
dist: trusty
env: TARGET="alpine"
if: tag IS blank
script: scripts/ci.bash
- name: "MacOS build"
os: osx
if: tag IS blank
script: travis_wait 30 scripts/ci.bash
- name: "Docker build"
os: linux
dist: trusty
if: branch == master AND tag IS blank
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin hub.docker.com
- docker build -t codercom/code-server:$VERSION .
git:
depth: 3
script: travis_wait 30 scripts/ci.bash
before_deploy:
- echo "$VERSION-vsc$VSCODE_VERSION" "$TRAVIS_COMMIT"
- git config --local user.name "$USER_NAME"
@ -40,9 +48,9 @@ before_deploy:
- git tag "$VERSION-vsc$VSCODE_VERSION" "$TRAVIS_COMMIT"
deploy:
provider: releases
- provider: releases
file_glob: true
draft: true
prerelease: true
tag_name: "$VERSION-vsc$VSCODE_VERSION"
target_commitish: "$TRAVIS_COMMIT"
name: "$VERSION-vsc$VSCODE_VERSION"
@ -55,6 +63,12 @@ deploy:
on:
repo: cdr/code-server
branch: master
- provider: script
script: docker push codercom/code-server:$VERSION
on:
repo: cdr/code-server
branch: master
condition: -n "$DOCKER_USERNAME"
cache:
yarn: true