mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 03:57:51 +02:00
Correctly delete all stopped versions except for the most recent 3 (#1511)
The gcloud command does some weird stuff with sorting when custom format is used. Here we instead rely on linux sort and head command to sort the versions list. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/google/nomulus/1511) <!-- Reviewable:end -->
This commit is contained in:
parent
cdcdde2c96
commit
1688d27b4e
1 changed files with 2 additions and 2 deletions
|
@ -52,8 +52,8 @@ steps:
|
||||||
do
|
do
|
||||||
for version in $(gcloud app versions list \
|
for version in $(gcloud app versions list \
|
||||||
--filter="SERVICE:$service AND SERVING_STATUS:STOPPED" \
|
--filter="SERVICE:$service AND SERVING_STATUS:STOPPED" \
|
||||||
--sort-by=LAST_DEPLOYED --format="value(VERSION.ID)" \
|
--format="value(VERSION.ID,LAST_DEPLOYED)" \
|
||||||
--project=$project_id | head -n -3)
|
--project=$project_id | sort -k 2 | head -n -3)
|
||||||
do
|
do
|
||||||
gcloud app versions delete $version --service=$service \
|
gcloud app versions delete $version --service=$service \
|
||||||
--project=$project_id --quiet;
|
--project=$project_id --quiet;
|
||||||
|
|
Loading…
Add table
Reference in a new issue