From d9c0c0580f81de0693798ca5f64343088766af23 Mon Sep 17 00:00:00 2001 From: Matt Rice Date: Sun, 10 May 2020 18:44:41 -0400 Subject: [PATCH] Delete old GAE versions on deployment (#1398) Signed-off-by: Matt Rice --- ci/deploy_to_staging.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ci/deploy_to_staging.sh b/ci/deploy_to_staging.sh index 5fcb5309c5..2dd6a4c9b6 100755 --- a/ci/deploy_to_staging.sh +++ b/ci/deploy_to_staging.sh @@ -30,3 +30,9 @@ gsutil cp gs://staging-deployment-configuration/voter-app.yaml voter-dapp/app.ya # Deploy docs ./scripts/deploy_docs.sh documentation/gae_app.yaml -q +# Delete old versions. +# TODO: this currently deletes any versions that aren't being used. It'd be preferable to leave the last few versions +# for each service. +VERSIONS_TO_DELETE=$(gcloud app versions list --filter="TRAFFIC_SPLIT=0.00" --format="value(VERSION.ID)") + +gcloud app versions delete -q $VERSIONS_TO_DELETE