From d57a80587e1608340c9ccd412ed335b1508b5aa4 Mon Sep 17 00:00:00 2001 From: stefda Date: Sat, 27 Feb 2021 08:07:42 +0100 Subject: [PATCH 1/2] feat: send traffic to latest revision If the traffic is ever sent to one of the previous revisions in the Cloud Run interface, deployment doesn't automatically send traffic to latest. This line makes sure that the traffic is sent to latest irrespective of any previous changes. Soon I'd like to make this optional. --- entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 5895c8a..9c3ea2f 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,9 +21,11 @@ gcloud auth configure-docker docker push "$INPUT_IMAGE" -gcloud beta run deploy "$INPUT_SERVICE" \ +gcloud run deploy "$INPUT_SERVICE" \ --image "$INPUT_IMAGE" \ --region "$INPUT_REGION" \ --platform managed \ --allow-unauthenticated \ ${ENV_FLAG} + +gcloud run services update-traffic "$INPUT_SERVICE" --to-latest From 0637a61469a24674bbdb76466d8588255710c71f Mon Sep 17 00:00:00 2001 From: stefda Date: Sat, 27 Feb 2021 08:19:50 +0100 Subject: [PATCH 2/2] fix: specify region when managing traffic --- entrypoint.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 9c3ea2f..a512f24 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -23,9 +23,11 @@ docker push "$INPUT_IMAGE" gcloud run deploy "$INPUT_SERVICE" \ --image "$INPUT_IMAGE" \ - --region "$INPUT_REGION" \ --platform managed \ + --region "$INPUT_REGION" \ --allow-unauthenticated \ ${ENV_FLAG} -gcloud run services update-traffic "$INPUT_SERVICE" --to-latest +gcloud run services update-traffic "$INPUT_SERVICE" --to-latest \ + --platform managed \ + --region "$INPUT_REGION"