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
·40 lines (37 loc) · 956 Bytes
/
cloudbuild.yaml
File metadata and controls
executable file
·40 lines (37 loc) · 956 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
34
35
36
37
38
39
40
steps:
- name: 'gcr.io/cloud-builders/docker'
id: generate-image-name
entrypoint: 'bash'
dir: scanners/https-processor
args:
- '-c'
- |
echo "gcr.io/$PROJECT_ID/https-processor:$BRANCH_NAME-$SHORT_SHA-$(date +%s)" > /workspace/imagename
- name: 'gcr.io/cloud-builders/docker'
id: build-results-if-master
entrypoint: 'bash'
dir: scanners/https-processor
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-results-if-master
entrypoint: 'bash'
dir: scanners/https-processor
args:
- '-c'
- |
if [[ "$BRANCH_NAME" == "master" ]]
then
image=$(cat /workspace/imagename)
docker push $image
else
exit 0
fi