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
executable file
·34 lines (31 loc) · 861 Bytes
/
cloudbuild.yaml
File metadata and controls
executable file
·34 lines (31 loc) · 861 Bytes
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
steps:
- name: 'gcr.io/track-compliance/ci'
id: test-db-migration-heads
dir: services/db-migration
entrypoint: /bin/sh
args: ["-c", "pip3 install psycopg2-binary pytest alembic SQLAlchemy && python3 -m pytest"]
- name: 'gcr.io/cloud-builders/docker'
id: build-db-migration-if-master
entrypoint: 'bash'
dir: services/db-migration
args:
- '-c'
- |
if [[ "$BRANCH_NAME" == "master" ]]
then
docker build -t gcr.io/$PROJECT_ID/services/db-migration:$BRANCH_NAME .
else
exit 0
fi
- name: 'gcr.io/cloud-builders/docker'
id: push-db-migration-if-master
entrypoint: 'bash'
args:
- '-c'
- |
if [[ "$BRANCH_NAME" == "master" ]]
then
docker push gcr.io/$PROJECT_ID/services/db-migration:$BRANCH_NAME
else
exit 0
fi