From 023f78fda600b441a349860ce03124046f7384a4 Mon Sep 17 00:00:00 2001 From: Ngure Nyaga Date: Mon, 12 Jul 2021 10:18:06 +0300 Subject: [PATCH] feat: enable Cloud Run deploys --- cloudbuild.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 6a8e9902..5caee178 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,4 +1,5 @@ steps: + # build the container image - name: "gcr.io/cloud-builders/docker" args: [ @@ -7,5 +8,24 @@ steps: "europe-west1-docker.pkg.dev/$PROJECT_ID/sghi/mle:$COMMIT_SHA", ".", ] + + # Push the container image to Container Registry + - name: "gcr.io/cloud-builders/docker" + args: + ["push", "europe-west1-docker.pkg.dev/$PROJECT_ID/sghi/mle:$COMMIT_SHA"] + + # Deploy an image from Container Registry to Cloud Run + - name: 'gcr.io/cloud-builders/gcloud' + args: [ + 'run', + 'deploy', + 'mle', + '--image', 'europe-west1-docker.pkg.dev/$PROJECT_ID/sghi/mle:$COMMIT_SHA', + '--region', 'europe-west1', + '--platform', 'managed', + '--allow-unauthenticated', + '--update-env-vars', 'SENTRY_ENVIRONMENT=prod,COMPRESS_ENABLED=true,DJANGO_DEBUG=false' + ] + images: - "europe-west1-docker.pkg.dev/$PROJECT_ID/sghi/mle:$COMMIT_SHA"