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
104 lines (96 loc) · 2.29 KB
/
Copy pathcloudbuild.yaml
File metadata and controls
104 lines (96 loc) · 2.29 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
steps:
- name: 'gcr.io/cloud-builders/docker'
id: start_arango
entrypoint: /bin/sh
args:
[
'-c',
'docker run -d --network=cloudbuild -p=8529:8529 -e ARANGO_ROOT_PASSWORD=$_DB_PASS --name=arangodb arangodb',
]
- name: mikewilliamson/wait-for
id: wait
args: ['arangodb:8529']
- name: node:alpine
id: install
dir: api-js
entrypoint: npm
args: ['ci', '--no-optional']
- name: node:alpine
id: lint
dir: api-js
entrypoint: npm
args: ['run', lint]
- name: node:alpine
id: test
dir: api-js
entrypoint: npm
args: ['test']
env:
- DB_PASS=$_DB_PASS
- DB_URL=$_DB_URL
- DB_NAME=$_DB_NAME
- AUTHENTICATED_KEY=$_AUTHENTICATED_KEY
- SIGN_IN_KEY=$_SIGN_IN_KEY
- NOTIFICATION_API_KEY=$_NOTIFICATION_API_KEY
- NOTIFICATION_API_URL=$_NOTIFICATION_API_URL
- DMARC_REPORT_API_SECRET=$_DMARC_REPORT_API_SECRET
- TOKEN_HASH=$_TOKEN_HASH
- DMARC_REPORT_API_TOKEN=$_DMARC_REPORT_API_TOKEN
- DMARC_REPORT_API_URL=$_DMARC_REPORT_API_URL
- DEPTH_LIMIT=$_DEPTH_LIMIT
- COST_LIMIT=$_COST_LIMIT
- SCALAR_COST=$_SCALAR_COST
- OBJECT_COST=$_OBJECT_COST
- LIST_FACTOR=$_LIST_FACTOR
- CIPHER_KEY=$_CIPHER_KEY
- DNS_SCANNER_ENDPOINT=$_DNS_SCANNER_ENDPOINT
- HTTPS_SCANNER_ENDPOINT=$_HTTPS_SCANNER_ENDPOINT
- SSL_SCANNER_ENDPOINT=$_SSL_SCANNER_ENDPOINT
- name: node:alpine
id: lingui-extract
dir: api-js
entrypoint: npm
args: ['run', 'extract']
- name: node:alpine
id: lingui-compile
dir: api-js
entrypoint: npm
args: ['run', 'compile']
- name: 'gcr.io/cloud-builders/docker'
id: generate-image-name
entrypoint: 'bash'
dir: api-js
args:
- '-c'
- |
echo "gcr.io/$PROJECT_ID/api-js:$BRANCH_NAME-$SHORT_SHA-$(date +%s)" > /workspace/imagename
- name: 'gcr.io/cloud-builders/docker'
id: build-if-master
entrypoint: 'bash'
dir: api-js
args:
- '-c'
- |
if [[ "$BRANCH_NAME" == "master" ]]
then
image=$(cat /workspace/imagename)
docker build -t $image .
else
exit 0
fi
- name: 'gcr.io/cloud-builders/docker'
id: push-if-master
entrypoint: 'bash'
args:
- '-c'
- |
if [[ "$BRANCH_NAME" == "master" ]]
then
image=$(cat /workspace/imagename)
docker push $image
else
exit 0
fi
timeout: 1200s
options:
machineType: 'E2_HIGHCPU_8'