google-nomulus/release/cloudbuild-tag.yaml
Weimin Yu ce2f98f680
Work around Spinnaker issue wrt variables (#465)
* Work around Spinnaker issue wrt variables

Cloud Build variable reference need to stay from the  ${var} pattern
to prevent Spinnaker from trying to resolve it. In all files that
are used by Spinnaker, we change variable reference to the $var form.

We made the minimum amount of change possible, and will review this
issue after the permanent solution is available.
2020-01-30 13:28:36 -05:00

32 lines
1.3 KiB
YAML

# To run the build locally, install cloud-build-local first.
# Then run:
# cloud-build-local --config=cloudbuild-tag.yaml --dryrun=false --substitutions \
# TAG_NAME=[TAG],_IMAGE=[IMAGE] ..
# This will add a "live" tag to the image in gcr.io/[PROJECT_ID]/[IMAGE]:[TAG].
# The PROJECT_ID is the current project name that gcloud uses.
#
# To manually trigger a build on GCB, run:
# gcloud builds submit --config cloudbuild-tag.yaml --substitutions \
# TAG_NAME=[TAG],_IMAGE=[IMAGE] ..
#
# To trigger a build automatically, follow the instructions below and add a trigger:
# https://cloud.google.com/cloud-build/docs/running-builds/automate-builds
#
# Note: to work around issue in Spinnaker's 'Deployment Manifest' stage,
# variable references must avoid the ${var} format. Valid formats include
# $var or ${"${var}"}. This file use the former. Since TAG_NAME is
# expanded in the copies sent to Spinnaker, we preserve the brackets around
# them for safe pattern matching during release.
# See https://github.com/spinnaker/spinnaker/issues/3028 for more information.
steps:
- name: 'gcr.io/$PROJECT_ID/builder:latest'
args:
- gcloud
- container
- images
- add-tag
- gcr.io/$PROJECT_ID/${_IMAGE}:${TAG_NAME}
- gcr.io/$PROJECT_ID/${_IMAGE}:live
timeout: 3600s
options:
machineType: 'N1_HIGHCPU_8'