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
78 lines (72 loc) · 1.86 KB
/
cloudbuild.yaml
File metadata and controls
78 lines (72 loc) · 1.86 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
steps:
# Passing POSTGRES_USER here creates a database of the same name
- name: 'gcr.io/cloud-builders/docker'
id: start_postgres
entrypoint: /bin/sh
args:
[
"-c",
"docker run -d --network=cloudbuild -p=5432:5432 -e POSTGRES_USER=$_DB_NAME -e POSTGRES_PASSWORD=$_DB_PASS --name=postgres postgres:alpine",
]
- name: mikewilliamson/wait-for
id: wait
args: ['postgres:5432']
- name: 'gcr.io/track-compliance/ci'
id: install
dir: api
entrypoint: pipenv
args: ['sync', '-d', '--bare']
env:
- PIPENV_NOSPIN=TRUE
- name: 'gcr.io/track-compliance/ci'
id: dbInit
dir: api
entrypoint: pipenv
args: ['run', 'db-upgrade']
env:
- DB_HOST=$_DB_HOST
- DB_NAME=$_DB_NAME
- DB_PASS=$_DB_PASS
- DB_PORT=$_DB_PORT
- DB_USER=$_DB_NAME
- name: 'gcr.io/track-compliance/ci'
id: test
dir: api
entrypoint: pipenv
args: ['run', 'test']
env:
- DB_HOST=$_DB_HOST
- DB_NAME=$_DB_NAME
- DB_PASS=$_DB_PASS
- DB_PORT=$_DB_PORT
- DB_USER=$_DB_NAME
- BASE32_SECRET=$_BASE32_SECRET
- SUPER_SECRET_KEY=$_SUPER_SECRET_KEY
- SUPER_SECRET_SALT=$_SUPER_SECRET_SALT
- NOTIFICATION_API_KEY=$_NOTIFICATION_API_KEY
- NOTIFICATION_API_URL=$_NOTIFICATION_API_URL
- name: 'gcr.io/cloud-builders/docker'
id: build-if-master
entrypoint: 'bash'
dir: api
args:
- '-c'
- |
if [[ "$BRANCH_NAME" == "master" ]]
then
docker build -t gcr.io/$PROJECT_ID/api:$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/api:$BRANCH_NAME-$SHORT_SHA
else
exit 0
fi