mirror of
https://github.com/google/nomulus.git
synced 2025-04-29 19:47: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
|
||||
for version in $(gcloud app versions list \
|
||||
--filter="SERVICE:$service AND SERVING_STATUS:STOPPED" \
|
||||
--sort-by=LAST_DEPLOYED --format="value(VERSION.ID)" \
|
||||
--project=$project_id | head -n -3)
|
||||
--format="value(VERSION.ID,LAST_DEPLOYED)" \
|
||||
--project=$project_id | sort -k 2 | head -n -3)
|
||||
do
|
||||
gcloud app versions delete $version --service=$service \
|
||||
--project=$project_id --quiet;
|
||||
|
|
Loading…
Add table
Reference in a new issue