From 9c1287eeeaabfbd85de9b4b032dc2d1e0d5b5a58 Mon Sep 17 00:00:00 2001 From: Hannah Pho Date: Thu, 27 Jun 2024 13:15:33 -0400 Subject: [PATCH] Update some build trigger configs; add a repo version bump step (#327) * Remove unused push yaml With the planned name change of cloudbuild.java.yaml, it will be confusing to have this file around. I can't find any scripts or triggers that use it, so should be safe to remove. * Add push yaml with java checks and repo version bump --- build/{ => ci}/cloudbuild.push.yaml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) rename build/{ => ci}/cloudbuild.push.yaml (56%) diff --git a/build/cloudbuild.push.yaml b/build/ci/cloudbuild.push.yaml similarity index 56% rename from build/cloudbuild.push.yaml rename to build/ci/cloudbuild.push.yaml index 18f32c77..465b1674 100644 --- a/build/cloudbuild.push.yaml +++ b/build/ci/cloudbuild.push.yaml @@ -16,17 +16,23 @@ # data change. steps: - # Push server image to container registry - - id: push-image - name: gcr.io/cloud-builders/docker - entrypoint: "bash" + +# Trigger downstream builds that listen for changes to multiple repos. + - id: update-repo-version + name: "gcr.io/cloud-builders/git" + entrypoint: /bin/bash args: - -c - | set -e - docker build -f build/Dockerfile \ - -t gcr.io/datcom-ci/datacommons-mini-api:$SHORT_SHA \ - -t gcr.io/datcom-ci/datacommons-mini-api:latest \ - . - docker push gcr.io/datcom-ci/datacommons-mini-api:$SHORT_SHA - docker push gcr.io/datcom-ci/datacommons-mini-api:latest + gcloud source repos clone deployment /tmp/deployment --project=datcom-ci + cd /tmp/deployment + ./scripts/update_external_repo_version.sh $REPO_NAME $SHORT_SHA + waitFor: ["-"] + +# Generate protoc, build, check-format and run test + - id: "format & test" + name: "maven:3-jdk-11" + entrypoint: "mvn" + args: ["com.spotify.fmt:fmt-maven-plugin:check", "test"] + waitFor: ["-"]