| # Copyright 2023 The Go Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style |
| # license that can be found in the LICENSE file. |
| |
| steps: |
| # Build the container image |
| - name: "gcr.io/cloud-builders/docker" |
| args: |
| - "build" |
| - "-t" |
| - "gcr.io/$PROJECT_ID/worker:$COMMIT_SHA" |
| - "-f" |
| - "godev/cmd/worker/Dockerfile" |
| - "." |
| # Push the container image to Container Registry |
| - name: "gcr.io/cloud-builders/docker" |
| args: |
| - "push" |
| - "gcr.io/$PROJECT_ID/worker:$COMMIT_SHA" |
| - name: golang |
| args: |
| - "go" |
| - "run" |
| - "golang.org/x/website/cmd/locktrigger@latest" |
| - "--project=$PROJECT_ID" |
| - "--build=$BUILD_ID" |
| - "--repo=https://go.googlesource.com/telemetry" |
| # Deploy container image to Cloud Run |
| - name: "gcr.io/google.com/cloudsdktool/cloud-sdk" |
| entrypoint: gcloud |
| args: |
| - "run" |
| - "deploy" |
| - "$_ENV-worker" |
| - "--image" |
| - "gcr.io/$PROJECT_ID/worker:$COMMIT_SHA" |
| - "--region" |
| - "us-central1" |
| - "--service-account" |
| - "$_RUN_SERVICE_ACCOUNT" |
| - "--set-env-vars" |
| - "GO_TELEMETRY_PROJECT_ID=$PROJECT_ID" |
| - "--set-env-vars" |
| - "GO_TELEMETRY_ENV=$_ENV" |
| - "--set-env-vars" |
| - "GO_TELEMETRY_IAP_SERVICE_ACCOUNT=$_IAP_SERVICE_ACCOUNT" |
| - "--set-env-vars" |
| - "GO_TELEMETRY_CLIENT_ID=$_CLIENT_ID" |
| - "--set-env-vars" |
| - "GO_TELEMETRY_LOCATION_ID=$_LOCATION_ID" |
| - "--set-env-vars" |
| - "GO_TELEMETRY_WORKER_URL=$_WORKER_URL" |
| images: |
| - "gcr.io/$PROJECT_ID/worker:$COMMIT_SHA" |