Skip to content

Commit 7ad2bcb

Browse files
lucacasonatocode-asher
authored andcommitted
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
1 parent a2ee6c8 commit 7ad2bcb

File tree

3 files changed

+44
-18
lines changed

3 files changed

+44
-18
lines changed

.travis.yml

+32-18
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,59 @@ jobs:
1919
dist: trusty
2020
env: TARGET="linux"
2121
if: tag IS blank
22+
script: scripts/ci.bash
2223
- name: "Alpine build"
2324
os: linux
2425
dist: trusty
2526
env: TARGET="alpine"
2627
if: tag IS blank
28+
script: scripts/ci.bash
2729
- name: "MacOS build"
2830
os: osx
2931
if: tag IS blank
32+
script: travis_wait 30 scripts/ci.bash
33+
- name: "Docker build"
34+
os: linux
35+
dist: trusty
36+
if: branch == master AND tag IS blank
37+
script:
38+
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin hub.docker.com
39+
- docker build -t codercom/code-server:$VERSION .
3040

3141
git:
3242
depth: 3
3343

34-
script: travis_wait 30 scripts/ci.bash
35-
3644
before_deploy:
3745
- echo "$VERSION-vsc$VSCODE_VERSION" "$TRAVIS_COMMIT"
3846
- git config --local user.name "$USER_NAME"
3947
- git config --local user.email "$USER_EMAIL"
4048
- git tag "$VERSION-vsc$VSCODE_VERSION" "$TRAVIS_COMMIT"
4149

4250
deploy:
43-
provider: releases
44-
file_glob: true
45-
draft: true
46-
tag_name: "$VERSION-vsc$VSCODE_VERSION"
47-
target_commitish: "$TRAVIS_COMMIT"
48-
name: "$VERSION-vsc$VSCODE_VERSION"
49-
skip_cleanup: true
50-
api_key:
51-
secure: YL/x24KjYjgYXPcJWk3FV7FGxI79Mh6gBECQEcdlf3fkLEoKFVgzHBoUNWrFPzyR4tgLyWNAgcpD9Lkme1TRWTom7UPjXcwMNyLcLa+uec7ciSAnYD9ntLTpiCuPDD1u0LtRGclSi/EHQ+F8YVq+HZJpXTsJeAmOmihma3GVbGKSZr+BRum+0YZSG4w+o4TOlYzw/4bLWS52MogZcwpjd+hemBbgXLuGU2ziKv2vEKCZFbEeA16II4x1WLI4mutDdCeh7+3aLzGLwDa49NxtsVYNjyNFF75JhCTCNA55e2YMiLz9Uq69IXe/mi5F7xUaFfhIqqLNyKBnKeEOzu3dYnc+8n3LjnQ+00PmkF05nx9kBn3UfV1kwQGh6QbyDmTtBP07rtUMyI14aeQqHjxsaVRdMnwj9Q2DjXRr8UDqESZF0rmK3pHCXS2fBhIzLE8tLVW5Heiba2pQRFMHMZW+KBE97FzcFh7is90Ait3T8enfcd/PWFPYoBejDAdjwxwOkezh5N5ZkYquEfDYuWrFi6zRFCktsruaAcA+xGtTf9oilBBzUqu8Ie+YFWH5me83xakcblJWdaW/D2rLJAJH3m6LFm8lBqyUgDX5t/etob6CpDuYHu5D1J3XINOj/+aLAcadq6qlh70PMZS3zYffUu3JlzaD2amlSHIT8b5YXFc=
52-
file:
53-
- release/*.tar.gz
54-
- release/*.zip
55-
on:
56-
repo: cdr/code-server
57-
branch: master
51+
- provider: releases
52+
file_glob: true
53+
prerelease: true
54+
tag_name: "$VERSION-vsc$VSCODE_VERSION"
55+
target_commitish: "$TRAVIS_COMMIT"
56+
name: "$VERSION-vsc$VSCODE_VERSION"
57+
skip_cleanup: true
58+
api_key:
59+
secure: YL/x24KjYjgYXPcJWk3FV7FGxI79Mh6gBECQEcdlf3fkLEoKFVgzHBoUNWrFPzyR4tgLyWNAgcpD9Lkme1TRWTom7UPjXcwMNyLcLa+uec7ciSAnYD9ntLTpiCuPDD1u0LtRGclSi/EHQ+F8YVq+HZJpXTsJeAmOmihma3GVbGKSZr+BRum+0YZSG4w+o4TOlYzw/4bLWS52MogZcwpjd+hemBbgXLuGU2ziKv2vEKCZFbEeA16II4x1WLI4mutDdCeh7+3aLzGLwDa49NxtsVYNjyNFF75JhCTCNA55e2YMiLz9Uq69IXe/mi5F7xUaFfhIqqLNyKBnKeEOzu3dYnc+8n3LjnQ+00PmkF05nx9kBn3UfV1kwQGh6QbyDmTtBP07rtUMyI14aeQqHjxsaVRdMnwj9Q2DjXRr8UDqESZF0rmK3pHCXS2fBhIzLE8tLVW5Heiba2pQRFMHMZW+KBE97FzcFh7is90Ait3T8enfcd/PWFPYoBejDAdjwxwOkezh5N5ZkYquEfDYuWrFi6zRFCktsruaAcA+xGtTf9oilBBzUqu8Ie+YFWH5me83xakcblJWdaW/D2rLJAJH3m6LFm8lBqyUgDX5t/etob6CpDuYHu5D1J3XINOj/+aLAcadq6qlh70PMZS3zYffUu3JlzaD2amlSHIT8b5YXFc=
60+
file:
61+
- release/*.tar.gz
62+
- release/*.zip
63+
on:
64+
repo: cdr/code-server
65+
branch: master
66+
- provider: script
67+
script: docker push codercom/code-server:$VERSION
68+
on:
69+
repo: cdr/code-server
70+
branch: master
71+
condition: -n "$DOCKER_USERNAME"
5872

5973
cache:
6074
yarn: true
6175
timeout: 1000
6276
directories:
63-
- .cache
77+
- .cache

scripts/cicd/build_binary.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
set -e
3+
4+
yarn task build:server:binary

scripts/cicd/git_tag.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "$VERSION" "$TRAVIS_COMMIT"
5+
git config --local user.name "$USER_NAME"
6+
git config --local user.email "$USER_EMAIL"
7+
git tag "$VERSION" "$TRAVIS_COMMIT"
8+
yarn task package "$VERSION"

0 commit comments

Comments
 (0)