Skip to content

Commit da8bf00

Browse files
committed
cleaned up .travis.yml and moved some code into a script
1 parent 6c0fc73 commit da8bf00

File tree

3 files changed

+38
-21
lines changed

3 files changed

+38
-21
lines changed

.travis.yml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ language: node_js
33
node_js:
44
- 10.15.1
55

6+
services:
7+
- docker
8+
69
env:
710
- VSCODE_VERSION="1.33.1" MAJOR_VERSION="1" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER-vsc$VSCODE_VERSION"
811

@@ -18,31 +21,37 @@ before_install:
1821
- npm install -g [email protected]
1922

2023
script:
21-
- scripts/build.sh
24+
- scripts/cicd/build_binary.sh
25+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; docker build -t coder/code-server:$VERSION .; fi
2226

2327
before_deploy:
24-
- echo "$VERSION" "$TRAVIS_COMMIT"
25-
- git config --local user.name "$USER_NAME"
26-
- git config --local user.email "$USER_EMAIL"
27-
- git tag "$VERSION" "$TRAVIS_COMMIT"
28-
- yarn task package "$VERSION"
28+
- scripts/cicd/git_tag.sh
29+
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin hub.docker.com
2930

3031
deploy:
31-
provider: releases
32-
file_glob: true
33-
draft: true
34-
tag_name: "$VERSION"
35-
target_commitish: "$TRAVIS_COMMIT"
36-
name: "$VERSION"
37-
skip_cleanup: true
38-
api_key:
39-
secure: YL/x24KjYjgYXPcJWk3FV7FGxI79Mh6gBECQEcdlf3fkLEoKFVgzHBoUNWrFPzyR4tgLyWNAgcpD9Lkme1TRWTom7UPjXcwMNyLcLa+uec7ciSAnYD9ntLTpiCuPDD1u0LtRGclSi/EHQ+F8YVq+HZJpXTsJeAmOmihma3GVbGKSZr+BRum+0YZSG4w+o4TOlYzw/4bLWS52MogZcwpjd+hemBbgXLuGU2ziKv2vEKCZFbEeA16II4x1WLI4mutDdCeh7+3aLzGLwDa49NxtsVYNjyNFF75JhCTCNA55e2YMiLz9Uq69IXe/mi5F7xUaFfhIqqLNyKBnKeEOzu3dYnc+8n3LjnQ+00PmkF05nx9kBn3UfV1kwQGh6QbyDmTtBP07rtUMyI14aeQqHjxsaVRdMnwj9Q2DjXRr8UDqESZF0rmK3pHCXS2fBhIzLE8tLVW5Heiba2pQRFMHMZW+KBE97FzcFh7is90Ait3T8enfcd/PWFPYoBejDAdjwxwOkezh5N5ZkYquEfDYuWrFi6zRFCktsruaAcA+xGtTf9oilBBzUqu8Ie+YFWH5me83xakcblJWdaW/D2rLJAJH3m6LFm8lBqyUgDX5t/etob6CpDuYHu5D1J3XINOj/+aLAcadq6qlh70PMZS3zYffUu3JlzaD2amlSHIT8b5YXFc=
40-
file:
41-
- release/*.tar.gz
42-
- release/*.zip
43-
on:
44-
repo: codercom/code-server
45-
branch: master
32+
- provider: releases
33+
file_glob: true
34+
draft: true
35+
tag_name: "$VERSION"
36+
target_commitish: "$TRAVIS_COMMIT"
37+
name: "$VERSION"
38+
skip_cleanup: true
39+
api_key:
40+
secure: YL/x24KjYjgYXPcJWk3FV7FGxI79Mh6gBECQEcdlf3fkLEoKFVgzHBoUNWrFPzyR4tgLyWNAgcpD9Lkme1TRWTom7UPjXcwMNyLcLa+uec7ciSAnYD9ntLTpiCuPDD1u0LtRGclSi/EHQ+F8YVq+HZJpXTsJeAmOmihma3GVbGKSZr+BRum+0YZSG4w+o4TOlYzw/4bLWS52MogZcwpjd+hemBbgXLuGU2ziKv2vEKCZFbEeA16II4x1WLI4mutDdCeh7+3aLzGLwDa49NxtsVYNjyNFF75JhCTCNA55e2YMiLz9Uq69IXe/mi5F7xUaFfhIqqLNyKBnKeEOzu3dYnc+8n3LjnQ+00PmkF05nx9kBn3UfV1kwQGh6QbyDmTtBP07rtUMyI14aeQqHjxsaVRdMnwj9Q2DjXRr8UDqESZF0rmK3pHCXS2fBhIzLE8tLVW5Heiba2pQRFMHMZW+KBE97FzcFh7is90Ait3T8enfcd/PWFPYoBejDAdjwxwOkezh5N5ZkYquEfDYuWrFi6zRFCktsruaAcA+xGtTf9oilBBzUqu8Ie+YFWH5me83xakcblJWdaW/D2rLJAJH3m6LFm8lBqyUgDX5t/etob6CpDuYHu5D1J3XINOj/+aLAcadq6qlh70PMZS3zYffUu3JlzaD2amlSHIT8b5YXFc=
41+
file:
42+
- release/*.tar.gz
43+
- release/*.zip
44+
on:
45+
repo: codercom/code-server
46+
branch: master
47+
- provider: script
48+
script: docker push coder/code-server:$VERSION
49+
on:
50+
repo: codercom/code-server
51+
branch: master
52+
condition: $TRAVIS_OS_NAME = linux
53+
54+
4655

4756
cache:
4857
yarn: true
File renamed without changes.

scripts/cicd/git_tag.sh

Lines changed: 8 additions & 0 deletions
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)