From a68db84bb4f0137904d3b85c0ecf70c05b9fdbd1 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Wed, 28 Feb 2024 11:05:21 -0500 Subject: [PATCH] chore: create release cloudbuild yaml for library_generation (#2510) # In this PR - We add a new `cloudbuild` yaml that is configured to push a new image tagged as `gcr.io/cloud-devrel-public-resources/java-library-generation:${_GAPIC_GENERATOR_JAVA_VERSION}` - We reorganize the folder structure of `sdk-platform-java/.cloudbuild` ## The new trigger It's called `library-generation-sdk-platform-java-release` ![image](https://github.com/googleapis/sdk-platform-java/assets/22083784/b14525c5-fbe9-4d33-9381-4e6cbfae686a) # Before merging this PR - [x] Update _all_ library_generation triggers to point to the new location (`.cloudbuild/library_generation`) - [x] Get approval from @mpeddada1 in order to: - [x] Update graalvm __test__ triggers to point to the new location (`.cloudbuild/graalvm`) - [x] Update graalvm release triggers to point to the new location (`.cloudbuild/graalvm`) --- .cloudbuild/google-cloud-sdk.repo | 8 ----- .../{ => graalvm}/cloudbuild-test-a.yaml | 4 +-- .../{ => graalvm}/cloudbuild-test-b.yaml | 4 +-- .cloudbuild/{ => graalvm}/cloudbuild.yaml | 4 +-- .../{ => graalvm}/graalvm_a.Dockerfile | 0 .../{ => graalvm}/graalvm_b.Dockerfile | 0 .../cloudbuild-library-generation-push.yaml} | 2 +- ...cloudbuild-library-generation-release.yaml | 31 +++++++++++++++++++ .../cloudbuild-test-library-generation.yaml | 2 +- .../library_generation.Dockerfile | 0 10 files changed, 39 insertions(+), 16 deletions(-) delete mode 100644 .cloudbuild/google-cloud-sdk.repo rename .cloudbuild/{ => graalvm}/cloudbuild-test-a.yaml (94%) rename .cloudbuild/{ => graalvm}/cloudbuild-test-b.yaml (94%) rename .cloudbuild/{ => graalvm}/cloudbuild.yaml (96%) rename .cloudbuild/{ => graalvm}/graalvm_a.Dockerfile (100%) rename .cloudbuild/{ => graalvm}/graalvm_b.Dockerfile (100%) rename .cloudbuild/{cloudbuild-library-generation.yaml => library_generation/cloudbuild-library-generation-push.yaml} (92%) create mode 100644 .cloudbuild/library_generation/cloudbuild-library-generation-release.yaml rename .cloudbuild/{ => library_generation}/cloudbuild-test-library-generation.yaml (94%) rename .cloudbuild/{ => library_generation}/library_generation.Dockerfile (100%) diff --git a/.cloudbuild/google-cloud-sdk.repo b/.cloudbuild/google-cloud-sdk.repo deleted file mode 100644 index 8c654dc317..0000000000 --- a/.cloudbuild/google-cloud-sdk.repo +++ /dev/null @@ -1,8 +0,0 @@ -[google-cloud-sdk] -name=Google Cloud SDK -baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64 -enabled=1 -gpgcheck=1 -repo_gpgcheck=0 -gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg - https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg diff --git a/.cloudbuild/cloudbuild-test-a.yaml b/.cloudbuild/graalvm/cloudbuild-test-a.yaml similarity index 94% rename from .cloudbuild/cloudbuild-test-a.yaml rename to .cloudbuild/graalvm/cloudbuild-test-a.yaml index 6727039eb0..01b99f820e 100644 --- a/.cloudbuild/cloudbuild-test-a.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-a.yaml @@ -21,7 +21,7 @@ steps: # GraalVM A build - name: gcr.io/cloud-builders/docker args: ["build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}", "--file", "graalvm_a.Dockerfile", "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", "."] - dir: .cloudbuild + dir: .cloudbuild/graalvm id: graalvm-a-build waitFor: ["-"] - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION} @@ -30,4 +30,4 @@ steps: waitFor: [ "graalvm-a-build" ] env: - 'MODULES_UNDER_TEST=java-kms' - - 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test' \ No newline at end of file + - 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test' diff --git a/.cloudbuild/cloudbuild-test-b.yaml b/.cloudbuild/graalvm/cloudbuild-test-b.yaml similarity index 94% rename from .cloudbuild/cloudbuild-test-b.yaml rename to .cloudbuild/graalvm/cloudbuild-test-b.yaml index 219aacc491..97d8256ebd 100644 --- a/.cloudbuild/cloudbuild-test-b.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-b.yaml @@ -21,7 +21,7 @@ steps: # GraalVM A build - name: gcr.io/cloud-builders/docker args: ["build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}", "--file", "graalvm_b.Dockerfile", "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", "."] - dir: .cloudbuild + dir: .cloudbuild/graalvm id: graalvm-b-build waitFor: ["-"] - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION} @@ -30,4 +30,4 @@ steps: waitFor: [ "graalvm-b-build" ] env: - 'MODULES_UNDER_TEST=java-kms' - - 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test' \ No newline at end of file + - 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test' diff --git a/.cloudbuild/cloudbuild.yaml b/.cloudbuild/graalvm/cloudbuild.yaml similarity index 96% rename from .cloudbuild/cloudbuild.yaml rename to .cloudbuild/graalvm/cloudbuild.yaml index 0f26b79b23..d0b0589bb9 100644 --- a/.cloudbuild/cloudbuild.yaml +++ b/.cloudbuild/graalvm/cloudbuild.yaml @@ -20,14 +20,14 @@ steps: # GraalVM A build - name: gcr.io/cloud-builders/docker args: ["build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}", "--file", "graalvm_a.Dockerfile", "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", "."] - dir: .cloudbuild + dir: .cloudbuild/graalvm id: graalvm-a-build waitFor: ["-"] # GraalVM B build - name: gcr.io/cloud-builders/docker args: [ "build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}", "--file", "graalvm_b.Dockerfile", "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", "." ] - dir: .cloudbuild + dir: .cloudbuild/graalvm id: graalvm-b-build waitFor: [ "-" ] diff --git a/.cloudbuild/graalvm_a.Dockerfile b/.cloudbuild/graalvm/graalvm_a.Dockerfile similarity index 100% rename from .cloudbuild/graalvm_a.Dockerfile rename to .cloudbuild/graalvm/graalvm_a.Dockerfile diff --git a/.cloudbuild/graalvm_b.Dockerfile b/.cloudbuild/graalvm/graalvm_b.Dockerfile similarity index 100% rename from .cloudbuild/graalvm_b.Dockerfile rename to .cloudbuild/graalvm/graalvm_b.Dockerfile diff --git a/.cloudbuild/cloudbuild-library-generation.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml similarity index 92% rename from .cloudbuild/cloudbuild-library-generation.yaml rename to .cloudbuild/library_generation/cloudbuild-library-generation-push.yaml index 7bdf371bfb..296cdb6db5 100644 --- a/.cloudbuild/cloudbuild-library-generation.yaml +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml @@ -24,7 +24,7 @@ steps: "build", "-t", "${_SHA_IMAGE_ID}", "-t", "${_LATEST_IMAGE_ID}", - "--file", ".cloudbuild/library_generation.Dockerfile", "."] + "--file", ".cloudbuild/library_generation/library_generation.Dockerfile", "."] id: library-generation-build waitFor: ["-"] diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-release.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-release.yaml new file mode 100644 index 0000000000..814bd001ea --- /dev/null +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-release.yaml @@ -0,0 +1,31 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +timeout: 7200s # 2 hours +substitutions: + _GAPIC_GENERATOR_JAVA_VERSION: '2.35.1-SNAPSHOT' # {x-version-update:gapic-generator-java:current} + _IMAGE_ID: "gcr.io/cloud-devrel-public-resources/java-library-generation:${_GAPIC_GENERATOR_JAVA_VERSION}" +steps: + # Library generation build + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "${_IMAGE_ID}", + "--file", ".cloudbuild/library_generation/library_generation.Dockerfile", "."] + id: library-generation-build + waitFor: ["-"] + +images: + - ${_IMAGE_ID} + diff --git a/.cloudbuild/cloudbuild-test-library-generation.yaml b/.cloudbuild/library_generation/cloudbuild-test-library-generation.yaml similarity index 94% rename from .cloudbuild/cloudbuild-test-library-generation.yaml rename to .cloudbuild/library_generation/cloudbuild-test-library-generation.yaml index 909a6439cf..6cdb333f19 100644 --- a/.cloudbuild/cloudbuild-test-library-generation.yaml +++ b/.cloudbuild/library_generation/cloudbuild-test-library-generation.yaml @@ -19,7 +19,7 @@ substitutions: steps: # Library generation build - name: gcr.io/cloud-builders/docker - args: ["build", "-t", "${_TEST_IMAGE_ID}", "--file", ".cloudbuild/library_generation.Dockerfile", "."] + args: ["build", "-t", "${_TEST_IMAGE_ID}", "--file", ".cloudbuild/library_generation/library_generation.Dockerfile", "."] id: library-generation-build waitFor: ["-"] - name: ${_TEST_IMAGE_ID} diff --git a/.cloudbuild/library_generation.Dockerfile b/.cloudbuild/library_generation/library_generation.Dockerfile similarity index 100% rename from .cloudbuild/library_generation.Dockerfile rename to .cloudbuild/library_generation/library_generation.Dockerfile