-
Notifications
You must be signed in to change notification settings - Fork 7
/
.travis.yml
59 lines (50 loc) · 1.69 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
language: node_js
node_js:
- "12"
git:
depth: 1
services:
- docker
stages:
- shared
- others
before_script:
- node ./utilities/version.js
matrix:
include:
- name: "shared-push"
stage: shared
if: type = push
script:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker build -t $DOCKER_USERNAME/shared:$TRAVIS_BRANCH cshub-shared
after_success:
- docker push $DOCKER_USERNAME/shared:$TRAVIS_BRANCH
- name: "client-push"
if: type = push
stage: others
script:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker build --build-arg BASE_IMAGE=$DOCKER_USERNAME/shared:$TRAVIS_BRANCH -t $DOCKER_USERNAME/client:$TRAVIS_BRANCH cshub-client
after_success:
- docker push $DOCKER_USERNAME/client:$TRAVIS_BRANCH
- name: "server-push"
if: type = push
stage: others
script:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker build --build-arg BASE_IMAGE=$DOCKER_USERNAME/shared:$TRAVIS_BRANCH -t $DOCKER_USERNAME/server:$TRAVIS_BRANCH cshub-server
after_success:
- docker push $DOCKER_USERNAME/server:$TRAVIS_BRANCH
- name: "client-pull"
if: type = pull_request
stage: others
script:
- docker build -t shared-$TRAVIS_PULL_REQUEST_SHA cshub-shared
- docker build --build-arg BASE_IMAGE=shared-$TRAVIS_PULL_REQUEST_SHA cshub-client
- name: "server-pull"
if: type = pull_request
stage: others
script:
- docker build -t shared-$TRAVIS_PULL_REQUEST_SHA cshub-shared
- docker build --build-arg BASE_IMAGE=shared-$TRAVIS_PULL_REQUEST_SHA cshub-server