mirror of
https://github.com/google/nomulus
synced 2026-05-28 10:40:44 +00:00
Add a step to cloudbuild-nomulus CB job to create a release in Cloud Deploy (#3059)
* add step to create cd release in cb-nomulus job * add variable for pipeline and region * pass image with digest to release * add source and skaffold to release command * remove new lines from script
This commit is contained in:
@@ -73,6 +73,7 @@ steps:
|
||||
- |
|
||||
nomulus_digest=$(gcloud container images list-tags gcr.io/${PROJECT_ID}/nomulus \
|
||||
--format="get(digest)" --filter="tags = ${TAG_NAME}")
|
||||
echo "$nomulus_digest" > /workspace/nomulus_digest
|
||||
proxy_digest=$(gcloud container images list-tags gcr.io/${PROJECT_ID}/proxy \
|
||||
--format="get(digest)" --filter="tags = ${TAG_NAME}")
|
||||
gcloud --project=${PROJECT_ID} beta container binauthz attestations \
|
||||
@@ -175,6 +176,33 @@ steps:
|
||||
cp db/build/libs/schema.jar output/
|
||||
cp core/build/libs/nomulus-public.jar output/
|
||||
cp core/build/libs/nomulus-tests-alldeps.jar output/
|
||||
# Create a release in Cloud Deploy to trigger the deployment pipeline
|
||||
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
||||
entrypoint: /bin/bash
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
set -e
|
||||
echo "============================================="
|
||||
echo "Triggering Google Cloud Deploy Release"
|
||||
echo "============================================="
|
||||
echo "Tag Name: ${TAG_NAME}"
|
||||
echo "Project ID: ${PROJECT_ID}"
|
||||
pipeline="deploy-nomulus"
|
||||
region="us-central1"
|
||||
# Release names must consist of lowercase letters, numbers, and hyphens.
|
||||
release_name=$(echo "${TAG_NAME}" | tr '[:upper:]' '[:lower:]' | tr '_' '-')
|
||||
echo "Release Name: $release_name"
|
||||
echo "============================================="
|
||||
# Read the pre-fetched image digest from the workspace file
|
||||
nomulus_digest=$(cat /workspace/nomulus_digest)
|
||||
gcloud deploy releases create "$release_name" \
|
||||
--delivery-pipeline="$pipeline" \
|
||||
--region="$region" \
|
||||
--project=${PROJECT_ID} \
|
||||
--images="nomulus=gcr.io/${PROJECT_ID}/nomulus@${nomulus_digest}" \
|
||||
--source=. \
|
||||
--skaffold-file=release/clouddeploy/skaffold.yaml
|
||||
# The tarballs and jars to upload to GCS.
|
||||
artifacts:
|
||||
objects:
|
||||
|
||||
Reference in New Issue
Block a user