Add auxiliary postdeploy steps to Cloud Deploy config (#3225)

I'm taking these from the Spinnaker pipeline. In prod we need to promote
the artifacts produced to "live" so that, for instance, Dataflow
pipelines get promoted/deployed.
This commit is contained in:
gbrodman
2026-08-31 21:43:20 +00:00
committed by GitHub
parent 8fc2ef99e4
commit c80b0a03bb
@@ -58,6 +58,18 @@ serialPipeline:
- |
gcloud storage cp gs://${PROJECT_ID}-deploy/${TAG_NAME}/cloudbuild-schema-deploy-${TARGET_ID}.yaml .
gcloud builds submit --no-source --config=cloudbuild-schema-deploy-${TARGET_ID}.yaml
- type: container
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:stable
env:
TARGET_ID: ${{ target.id }}
TAG_NAME: ${{ deploy_params['tag_name'] }}
PROJECT_ID: ${{ deploy_params['project_id'] }}
command: ["/bin/bash"]
args:
- "-c"
- |
gcloud storage cp gs://${PROJECT_ID}-deploy/${TAG_NAME}/cloudbuild-deploy-gke-${TARGET_ID}.yaml .
gcloud builds submit --no-source --config=cloudbuild-deploy-gke-${TARGET_ID}.yaml
analysis:
# 10 minutes.
duration: 600s
@@ -130,6 +142,18 @@ serialPipeline:
- |
gcloud storage cp gs://${PROJECT_ID}-deploy/${TAG_NAME}/cloudbuild-schema-deploy-${TARGET_ID}.yaml .
gcloud builds submit --no-source --config=cloudbuild-schema-deploy-${TARGET_ID}.yaml
- type: container
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:stable
env:
TARGET_ID: ${{ target.id }}
TAG_NAME: ${{ deploy_params['tag_name'] }}
PROJECT_ID: ${{ deploy_params['project_id'] }}
command: ["/bin/bash"]
args:
- "-c"
- |
gcloud storage cp gs://${PROJECT_ID}-deploy/${TAG_NAME}/cloudbuild-deploy-gke-${TARGET_ID}.yaml .
gcloud builds submit --no-source --config=cloudbuild-deploy-gke-${TARGET_ID}.yaml
analysis:
# 10 minutes.
duration: 600s
@@ -190,6 +214,17 @@ serialPipeline:
- |
gcloud container images add-tag $DEPLOYED_IMAGE \
${BASE_IMAGE}:live-cd-${TARGET_ID} --quiet
- type: container
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:stable
env:
TAG_NAME: ${{ deploy_params['tag_name'] }}
PROJECT_ID: ${{ deploy_params['project_id'] }}
command: ["/bin/bash"]
args:
- "-c"
- |
gcloud storage cp gs://${PROJECT_ID}-deploy/${TAG_NAME}/cloudbuild-sync-and-tag.yaml .
gcloud builds submit --no-source --config=cloudbuild-sync-and-tag.yaml
- type: container
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:stable
env:
@@ -202,6 +237,18 @@ serialPipeline:
- |
gcloud storage cp gs://${PROJECT_ID}-deploy/${TAG_NAME}/cloudbuild-schema-deploy-${TARGET_ID}.yaml .
gcloud builds submit --no-source --config=cloudbuild-schema-deploy-${TARGET_ID}.yaml
- type: container
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:stable
env:
TARGET_ID: ${{ target.id }}
TAG_NAME: ${{ deploy_params['tag_name'] }}
PROJECT_ID: ${{ deploy_params['project_id'] }}
command: ["/bin/bash"]
args:
- "-c"
- |
gcloud storage cp gs://${PROJECT_ID}-deploy/${TAG_NAME}/cloudbuild-deploy-gke-${TARGET_ID}.yaml .
gcloud builds submit --no-source --config=cloudbuild-deploy-gke-${TARGET_ID}.yaml
analysis:
# 10 minutes.
duration: 600s