# This will delete canary GAE versions named "nomulus". # # For reasons unknown, Spinnaker occasionally gets stuck when deploying to GAE # canary, and the fix is to manually delete the canary versions before the # deployment. # # To manually trigger a build on GCB, run: # gcloud builds submit --config=cloudbuild-delete-canary.yaml \ # --substitutions=_ENV=[ENV] .. # # To trigger a build automatically, follow the instructions below and add a trigger: # https://cloud.google.com/cloud-build/docs/running-builds/automate-builds # steps: # Pull the credential for nomulus tool. - name: 'gcr.io/$PROJECT_ID/builder:latest' entrypoint: /bin/bash args: - -c - | set -e gcloud secrets versions access latest \ --secret nomulus-tool-cloudbuild-credential > tool-credential.json # Delete unused GAE versions. - name: 'gcr.io/$PROJECT_ID/builder:latest' entrypoint: /bin/bash args: - -c - | if [ ${_ENV} == production ] then project_id="domain-registry" else project_id="domain-registry-${_ENV}" fi gcloud auth activate-service-account --key-file=tool-credential.json for service in default pubapi backend bsa tools console do gcloud app versions delete nomulus --service=$service \ --project=$project_id --quiet; done timeout: 3600s options: machineType: 'N1_HIGHCPU_8'