diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-integration-test.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-integration-test.yaml index e2f64715f8..fbd63988dc 100644 --- a/.cloudbuild/library_generation/cloudbuild-library-generation-integration-test.yaml +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-integration-test.yaml @@ -63,40 +63,20 @@ steps: id: prepare-golden waitFor: ["-"] -#- name: ubuntu:24.04 -# entrypoint: bash -# args: -# - "-c" -# - | -# # Install docker -# apt update -# apt install -y ca-certificates curl gnupg lsb-release -# mkdir -p /etc/apt/keyrings -# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \ -# gpg --dearmor -o /etc/apt/keyrings/docker.gpg -# echo \ -# "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ -# $(lsb_release -cs) stable" | \ -# tee /etc/apt/sources.list.d/docker.list > /dev/null -# apt update -# apt -y install \ -# docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -# docker run \ -# --rm \ -# --quiet \ -# -u "$(id -u):$(id -g)" \ -# -v "/workspace/google-cloud-java:/workspace" \ -# -v "/workspace/hermetic_build/library_generation/tests/resources/integration/google-cloud-java:/workspace/config" \ -# -v "/workspace/googleapis:/workspace/apis" \ -# "${_TEST_IMAGE}" \ -# --generation-config-path="/workspace/config/generation_config.yaml" \ -# --api-definitions-path="/workspace/apis" -# id: generate-libraries -# waitFor: [ -# "build-image", -# "download-api-definitions", -# "prepare-golden" -# ] +- name: ubuntu:24.04 + entrypoint: bash + args: + - "-c" + - | + apt update && apt install -y maven + mvn dependency:copy \ + -B -ntp \ + -Dartifact=com.google.api:gapic-generator-java:2.38.1 \ + -DoutputDirectory=/workspace + cd /workspace + mv gapic-generator-java-2.38.1.jar gapic-generator-java.jar + id: prepare-generator-jar + waitFor: [ "-" ] - name: gcr.io/cloud-builders/docker args: [ @@ -105,6 +85,9 @@ steps: "-v", "/workspace/google-cloud-java:/workspace", "-v", "/workspace/hermetic_build/library_generation/tests/resources/integration/google-cloud-java:/workspace/config", "-v", "/workspace/googleapis:/workspace/apis", + # Fix gapic-generator-java so that the generation result stays + # the same. + "-v", "/workspace/gapic-generator-java.jar:/home/.library_generation/gapic-generator-java.jar", "${_TEST_IMAGE}", "--generation-config-path=/workspace/config/generation_config.yaml", "--api-definitions-path=/workspace/apis" @@ -115,7 +98,8 @@ steps: waitFor: [ "build-image", "download-api-definitions", - "prepare-golden" + "prepare-golden", + "prepare-generator-jar" ] - name: ubuntu:24.04