Skip to content

Commit ff4c326

Browse files
authored
Delete step to push to release repo, trigger next release steps based on tag format (#2833)
* Change release cb file * Add brackets around tag variable * Redo tag matching * Have tag matcher like the one in cb dev
1 parent 51b5798 commit ff4c326

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

release/cloudbuild-release.yaml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -280,27 +280,25 @@ steps:
280280
rm ${gradle_bin}
281281
sed -i s%services.gradle.org/distributions%storage.googleapis.com/${gcs_loc}% \
282282
gradle/wrapper/gradle-wrapper.properties
283-
# Check out the release repo.
283+
# Conditionally trigger the appropriate build based on the tag format.
284284
- name: 'gcr.io/cloud-builders/gcloud'
285-
args: ['source', 'repos', 'clone', 'nomulus-release']
286-
# Tag and check in the release repo.
287-
- name: 'gcr.io/cloud-builders/git'
288-
entrypoint: /bin/bash
285+
entrypoint: 'bash'
289286
args:
290287
- -c
291288
- |
292289
set -e
293-
rm -rf gcompute-tools
294-
cp -rf nomulus-release/.git .
295-
rm -rf nomulus-release
296-
git config --global user.name "Cloud Build"
297-
git config --global user.email \
298-
$(gcloud auth list --format='get(account)' --filter=active)
299-
git add .
300-
git commit -m "Release commit for tag ${TAG_NAME}"
301-
git push -o nokeycheck origin master
302-
git tag ${TAG_NAME}
303-
git push -o nokeycheck origin ${TAG_NAME}
290+
# Check for a nomulus release tag (e.g., "v1.2.3")
291+
if [[ "${TAG_NAME}" =~ ^nomulus-20\d{2}[0-1]\d[0-3]\d-RC\d{2}$ ]]; then
292+
echo "Tag format matches a nomulus release. Triggering nomulus build..."
293+
gcloud builds submit . --config=release/cloudbuild-nomulus.yaml --substitutions=TAG_NAME=$TAG_NAME
294+
# Check for a proxy release tag (e.g., "proxy-v1.2.3")
295+
elif [[ "${TAG_NAME}" =~ ^proxy-20\d{2}[0-1]\d[0-3]\d-RC\d{2}$ ]]; then
296+
echo "Tag format matches a proxy release. Triggering proxy build..."
297+
gcloud builds submit . --config=release/cloudbuild-proxy.yaml --substitutions=TAG_NAME=$TAG_NAME
298+
else
299+
echo "Tag format '$TAG_NAME' does not match a known release type. Exiting."
300+
exit 1
301+
fi
304302
timeout: 3600s
305303
options:
306304
machineType: 'E2_HIGHCPU_32'

0 commit comments

Comments
 (0)