mirror of
https://github.com/google/nomulus.git
synced 2025-04-29 19:47:51 +02:00
Use the service account credential to delete unused versions (#1484)
This commit is contained in:
parent
6cfe4ddf4f
commit
7763e8e95a
1 changed files with 14 additions and 2 deletions
|
@ -19,11 +19,21 @@
|
|||
# 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:
|
||||
# Delete unused GAE versions.
|
||||
#
|
||||
# GAE has a limit of ~250 versions per-project, including unused versions. We
|
||||
# therefore need to periodically delete old versions. This GCB job finds all
|
||||
# stopped versions and delete all but the last 3 (in case we need to rollback).
|
||||
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:
|
||||
|
@ -36,6 +46,8 @@ steps:
|
|||
project_id="domain-registry-${_ENV}"
|
||||
fi
|
||||
|
||||
gcloud auth activate-service-account --key-file=tool-credential.json
|
||||
|
||||
for service in default pubapi backend tools
|
||||
do
|
||||
for version in $(gcloud app versions list \
|
||||
|
|
Loading…
Add table
Reference in a new issue