Skip to content

Commit 21a7ce1

Browse files
authored
Add cloudbuild file for ci image (canada-ca#2889)
This commit automates the rebuilding of our ci image in case the dockerfile is changed.
1 parent d38e5f1 commit 21a7ce1

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

ci/cloudbuild.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
steps:
2+
3+
- name: 'gcr.io/cloud-builders/docker'
4+
id: build-if-master
5+
entrypoint: 'bash'
6+
dir: ci
7+
args:
8+
- '-c'
9+
- |
10+
if [[ "$BRANCH_NAME" == "master" ]]
11+
then
12+
docker build -t gcr.io/track-compliance/ci .
13+
else
14+
exit 0
15+
fi
16+
17+
- name: 'gcr.io/cloud-builders/docker'
18+
id: push-if-master
19+
entrypoint: 'bash'
20+
dir: ci
21+
args:
22+
- '-c'
23+
- |
24+
if [[ "$BRANCH_NAME" == "master" ]]
25+
then
26+
docker push gcr.io/track-compliance/ci
27+
else
28+
exit 0
29+
fi

0 commit comments

Comments
 (0)