forked from GoogleCloudPlatform/marketplace-testrunner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild-tag.yaml
33 lines (28 loc) · 852 Bytes
/
cloudbuild-tag.yaml
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/cloud-builders/docker
args:
- pull
- gcr.io/$_STAGING_PROJECT_ID/testrunner:sha_$COMMIT_SHA
- name: gcr.io/cloud-builders/docker
args:
- tag
- gcr.io/$_STAGING_PROJECT_ID/testrunner:sha_$COMMIT_SHA
- gcr.io/$PROJECT_ID/testrunner:$TAG_NAME
- name: gcr.io/cloud-builders/gcloud
entrypoint: /bin/bash
args:
- -ceu
- echo "$(cloudbuild/should_tag_latest.sh gcr.io/$PROJECT_ID/testrunner $TAG_NAME)" > should_tag_latest
- name: gcr.io/cloud-builders/docker
entrypoint: /bin/bash
args:
- -ceu
- |
if [[ "$(cat should_tag_latest)" == "true" ]]; then
docker tag gcr.io/$PROJECT_ID/testrunner:$TAG_NAME gcr.io/$PROJECT_ID/testrunner:latest
docker push gcr.io/$PROJECT_ID/testrunner:latest
else
echo "Not tagging latest"
fi
images:
- gcr.io/$PROJECT_ID/testrunner:$TAG_NAME