Skip to content

Commit 81df866

Browse files
authoredJun 13, 2024··
feat: push SNAPSHOT versions of the hermetic build docker image (#2888)
This PR simplifies the setup of image publication. It will now rely on a single Cloud Build workflow that will push an image with three tags whenever there is a push to the `main` branch (i.e. merged PR): - An image tagged with the commit SHA of the merged commit - An image tagged `latest` - An image tagged with the generator version (e.g. 1.1.1-SNAPSHOT or 1.1.1 when it's a release PR) ** Follow ups ** - [ ] disable the release trigger in Cloud Build
1 parent d567453 commit 81df866

File tree

2 files changed

+4
-31
lines changed

2 files changed

+4
-31
lines changed
 

‎.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,23 @@
1515
timeout: 7200s # 2 hours
1616
substitutions:
1717
_IMAGE_NAME: "gcr.io/cloud-devrel-public-resources/java-library-generation"
18+
_GAPIC_GENERATOR_JAVA_VERSION: '2.41.1-SNAPSHOT' # {x-version-update:gapic-generator-java:current}
1819
_SHA_IMAGE_ID: "${_IMAGE_NAME}:${COMMIT_SHA}"
1920
_LATEST_IMAGE_ID: "${_IMAGE_NAME}:latest"
21+
_VERSIONED_IMAGE_ID: "${_IMAGE_NAME}:${_GAPIC_GENERATOR_JAVA_VERSION}"
2022
steps:
2123
# Library generation build
2224
- name: gcr.io/cloud-builders/docker
2325
args: [
2426
"build",
2527
"-t", "${_SHA_IMAGE_ID}",
2628
"-t", "${_LATEST_IMAGE_ID}",
29+
"-t", "${_VERSIONED_IMAGE_ID}",
2730
"--file", ".cloudbuild/library_generation/library_generation.Dockerfile", "."]
2831
id: library-generation-build
2932
waitFor: ["-"]
3033

3134
images:
3235
- ${_SHA_IMAGE_ID}
3336
- ${_LATEST_IMAGE_ID}
37+
- ${_VERSIONED_IMAGE_ID}

‎.cloudbuild/library_generation/cloudbuild-library-generation-release.yaml

-31
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.