-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
31 lines (31 loc) · 1.1 KB
/
Copy pathcloudbuild.yaml
File metadata and controls
31 lines (31 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# GitOps deploy: build the Flask viewer image and ship it to Cloud Run.
# Fired by the Cloud Build trigger (agent-scout-deploy) on pushes to main that touch v2/** —
# i.e. when the agent commits a battlecard update (or viewer code changes). The agent's commit
# -> this build -> live, so Cloud Run refreshes alongside Streamlit. No cron.
#
# Deploys by --image only, so the service's existing config (env vars, secrets, scaling, the
# allUsers invoker binding) is preserved across deploys; this build just swaps in the new image.
steps:
- id: build
name: gcr.io/cloud-builders/docker
dir: v2
args: ['build', '-t', '${_IMAGE}', '.']
- id: push
name: gcr.io/cloud-builders/docker
args: ['push', '${_IMAGE}']
- id: deploy
name: gcr.io/google.com/cloudsdktool/cloud-sdk
entrypoint: gcloud
args:
- run
- deploy
- agent-scout
- --image=${_IMAGE}
- --region=us-west1
- --quiet
images:
- '${_IMAGE}'
substitutions:
_IMAGE: 'us-west1-docker.pkg.dev/${PROJECT_ID}/cloud-run-source-deploy/agent-scout:${SHORT_SHA}'
options:
logging: CLOUD_LOGGING_ONLY