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
74 lines (67 loc) · 1.94 KB
/
cloudbuild.yaml
File metadata and controls
74 lines (67 loc) · 1.94 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
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/arangodb:3.12.1',
]
- name: mikewilliamson/wait-for
id: wait
args: ['arangodb:8529']
- name: node:alpine
id: install-dependencies
dir: services/progress-report
entrypoint: npm
args: ['ci', '--no-optional']
- name: node:alpine
id: run-eslint
dir: services/progress-report
entrypoint: npm
args: ['run', lint]
- name: node:alpine
id: test
dir: services/progress-report
entrypoint: npm
args: ['test']
env:
- DB_URL=$_DB_URL
- DB_PASS=$_DB_PASS
- DB_NAME=$_DB_NAME
- NOTIFICATION_API_KEY=$_NOTIFICATION_API_KEY
- NOTIFICATION_API_URL=$_NOTIFICATION_API_URL
- UNCLAIMED_ORG_ID=$_UNCLAIMED_ORG_ID
- REDIRECT_TO_SERVICE_ACCOUNT_EMAIL=$_REDIRECT_TO_SERVICE_ACCOUNT_EMAIL
- SERVICE_ACCOUNT_EMAIL=$_SERVICE_ACCOUNT_EMAIL
- name: 'gcr.io/cloud-builders/docker'
id: generate-image-name
entrypoint: 'bash'
dir: services/progress-report
args:
- '-c'
- |
echo "northamerica-northeast1-docker.pkg.dev/track-compliance/tracker/services/progress-report:$(echo $BRANCH_NAME | sed 's/[^a-zA-Z0-9]/-/g')-$SHORT_SHA-$(date +%s)" > /workspace/imagename
- name: 'gcr.io/cloud-builders/docker'
id: build
entrypoint: 'bash'
dir: services/progress-report
args:
- '-c'
- |
image=$(cat /workspace/imagename)
docker build -t $image .
- name: 'gcr.io/cloud-builders/docker'
id: push-if-master
entrypoint: 'bash'
dir: services/progress-report
args:
- '-c'
- |
if [[ "$BRANCH_NAME" == "master" ]]
then
image=$(cat /workspace/imagename)
docker push $image
else
exit 0
fi