forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
64 lines (56 loc) · 1.21 KB
/
cloudbuild.yaml
File metadata and controls
64 lines (56 loc) · 1.21 KB
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
60
61
62
63
64
steps:
- name: node:alpine
id: install
dir: frontend
entrypoint: npm
args: ['ci', '--no-optional']
- name: node:alpine
id: lint
dir: frontend
entrypoint: npm
args: ['run', 'lint']
- name: node:alpine
id: test
dir: frontend
entrypoint: npm
args: ['test']
- name: node:alpine
id: lingui-extract
dir: frontend
entrypoint: npm
args: ['run', 'extract']
- name: node:alpine
id: lingui-compile
dir: frontend
entrypoint: npm
args: ['run', 'compile']
- name: node:alpine
id: build-production-bundle
dir: frontend
entrypoint: npm
args: ['run', 'build']
- name: 'gcr.io/cloud-builders/docker'
id: build-if-master
entrypoint: 'bash'
dir: frontend
args:
- '-c'
- |
if [[ "$BRANCH_NAME" == "master" ]]
then
docker build -t gcr.io/$PROJECT_ID/frontend:$BRANCH_NAME-$SHORT_SHA .
else
exit 0
fi
- name: 'gcr.io/cloud-builders/docker'
id: push-if-master
entrypoint: 'bash'
args:
- '-c'
- |
if [[ "$BRANCH_NAME" == "master" ]]
then
docker push gcr.io/$PROJECT_ID/frontend:$BRANCH_NAME-$SHORT_SHA
else
exit 0
fi