From b8c3d96fcd4cebf4d7b30d75376576aac97c3b24 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Tue, 17 Sep 2019 18:53:25 +0200 Subject: [PATCH] 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 --- .travis.yml | 50 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index f12fbc1c..f98135be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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,24 +48,30 @@ before_deploy: - git tag "$VERSION-vsc$VSCODE_VERSION" "$TRAVIS_COMMIT" deploy: - provider: releases - file_glob: true - draft: true - tag_name: "$VERSION-vsc$VSCODE_VERSION" - target_commitish: "$TRAVIS_COMMIT" - name: "$VERSION-vsc$VSCODE_VERSION" - skip_cleanup: true - api_key: - secure: YL/x24KjYjgYXPcJWk3FV7FGxI79Mh6gBECQEcdlf3fkLEoKFVgzHBoUNWrFPzyR4tgLyWNAgcpD9Lkme1TRWTom7UPjXcwMNyLcLa+uec7ciSAnYD9ntLTpiCuPDD1u0LtRGclSi/EHQ+F8YVq+HZJpXTsJeAmOmihma3GVbGKSZr+BRum+0YZSG4w+o4TOlYzw/4bLWS52MogZcwpjd+hemBbgXLuGU2ziKv2vEKCZFbEeA16II4x1WLI4mutDdCeh7+3aLzGLwDa49NxtsVYNjyNFF75JhCTCNA55e2YMiLz9Uq69IXe/mi5F7xUaFfhIqqLNyKBnKeEOzu3dYnc+8n3LjnQ+00PmkF05nx9kBn3UfV1kwQGh6QbyDmTtBP07rtUMyI14aeQqHjxsaVRdMnwj9Q2DjXRr8UDqESZF0rmK3pHCXS2fBhIzLE8tLVW5Heiba2pQRFMHMZW+KBE97FzcFh7is90Ait3T8enfcd/PWFPYoBejDAdjwxwOkezh5N5ZkYquEfDYuWrFi6zRFCktsruaAcA+xGtTf9oilBBzUqu8Ie+YFWH5me83xakcblJWdaW/D2rLJAJH3m6LFm8lBqyUgDX5t/etob6CpDuYHu5D1J3XINOj/+aLAcadq6qlh70PMZS3zYffUu3JlzaD2amlSHIT8b5YXFc= - file: - - release/*.tar.gz - - release/*.zip - on: - repo: cdr/code-server - branch: master + - provider: releases + file_glob: true + prerelease: true + tag_name: "$VERSION-vsc$VSCODE_VERSION" + target_commitish: "$TRAVIS_COMMIT" + name: "$VERSION-vsc$VSCODE_VERSION" + skip_cleanup: true + api_key: + secure: YL/x24KjYjgYXPcJWk3FV7FGxI79Mh6gBECQEcdlf3fkLEoKFVgzHBoUNWrFPzyR4tgLyWNAgcpD9Lkme1TRWTom7UPjXcwMNyLcLa+uec7ciSAnYD9ntLTpiCuPDD1u0LtRGclSi/EHQ+F8YVq+HZJpXTsJeAmOmihma3GVbGKSZr+BRum+0YZSG4w+o4TOlYzw/4bLWS52MogZcwpjd+hemBbgXLuGU2ziKv2vEKCZFbEeA16II4x1WLI4mutDdCeh7+3aLzGLwDa49NxtsVYNjyNFF75JhCTCNA55e2YMiLz9Uq69IXe/mi5F7xUaFfhIqqLNyKBnKeEOzu3dYnc+8n3LjnQ+00PmkF05nx9kBn3UfV1kwQGh6QbyDmTtBP07rtUMyI14aeQqHjxsaVRdMnwj9Q2DjXRr8UDqESZF0rmK3pHCXS2fBhIzLE8tLVW5Heiba2pQRFMHMZW+KBE97FzcFh7is90Ait3T8enfcd/PWFPYoBejDAdjwxwOkezh5N5ZkYquEfDYuWrFi6zRFCktsruaAcA+xGtTf9oilBBzUqu8Ie+YFWH5me83xakcblJWdaW/D2rLJAJH3m6LFm8lBqyUgDX5t/etob6CpDuYHu5D1J3XINOj/+aLAcadq6qlh70PMZS3zYffUu3JlzaD2amlSHIT8b5YXFc= + file: + - release/*.tar.gz + - release/*.zip + 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 timeout: 1000 directories: - - .cache + - .cache \ No newline at end of file