Skip to content

Commit fc05d57

Browse files
feat: support dynamic image tags (#345)
1 parent 8512b9a commit fc05d57

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

cloudbuild.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,29 @@
1515
# Default cloudbuild.yaml for Cloud Shell custom images.
1616
# This file is used by the Cloud Build trigger that builds this image.
1717

18+
substitutions:
19+
_IMAGE_TAG: '${COMMIT_SHA}'
20+
1821
steps:
1922
- name: "gcr.io/cloud-builders/docker"
2023
args:
2124
[
2225
"build",
2326
"-t",
24-
"gcr.io/$PROJECT_ID/button",
27+
"gcr.io/$PROJECT_ID/button:latest",
2528
"-t",
26-
"gcr.io/$PROJECT_ID/button:public-image-${COMMIT_SHA}",
29+
"gcr.io/$PROJECT_ID/button:public-image-${_IMAGE_TAG}",
2730
".",
2831
]
2932
- name: "gcr.io/cloudshell-images/custom-image-validation"
3033
args: ["image_test.py", "--image", "gcr.io/$PROJECT_ID/button"]
34+
3135
images:
32-
- "gcr.io/$PROJECT_ID/button"
33-
- "gcr.io/$PROJECT_ID/button:public-image-${COMMIT_SHA}"
36+
- "gcr.io/$PROJECT_ID/button:latest"
37+
- "gcr.io/$PROJECT_ID/button:public-image-${_IMAGE_TAG}"
38+
3439
timeout: "3600s"
40+
3541
options:
3642
machineType: "N1_HIGHCPU_8"
43+
dynamicSubstitutions: true

0 commit comments

Comments
 (0)