-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild-webapp.yaml
More file actions
58 lines (58 loc) · 1.71 KB
/
Copy pathcloudbuild-webapp.yaml
File metadata and controls
58 lines (58 loc) · 1.71 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Cloud Build config for webapp. Reused by per-environment triggers (dev, qa, staging, prod).
# Each trigger sets _REGION and _ENVIRONMENT; deploys Cloud Run service "${_ENVIRONMENT}-webapp".
substitutions:
_REGION: us-east4
_SERVICE: edvise-api
steps:
- name: ghcr.io/astral-sh/uv:debian
entrypoint: bash
args:
- -c
- |
set -e
apt-get update && apt-get install -y --no-install-recommends git
uv lock --upgrade-package edvise
- name: gcr.io/cloud-builders/docker
args:
- build
- "-f"
- src/webapp/Dockerfile
- "-t"
- "${_REGION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/webapp:$COMMIT_SHA"
- "-t"
- "${_REGION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/webapp:latest"
- .
- name: gcr.io/cloud-builders/docker
args:
- push
- "${_REGION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/webapp:$COMMIT_SHA"
- name: gcr.io/cloud-builders/docker
args:
- push
- "${_REGION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/webapp:latest"
- name: gcr.io/cloud-builders/gcloud
args:
- run
- deploy
- "${_SERVICE}"
- "--image"
- "${_REGION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/webapp:$COMMIT_SHA"
- "--region"
- "${_REGION}"
- name: curlimages/curl
args:
- "-X"
- POST
- "-H"
- "Content-Type: application/json"
- "-f"
- "-d"
- >-
{"text":"🚀 $TRIGGER_NAME → *$REPO_NAME* deployed · `$BRANCH_NAME`"}
- >-
https://hooks.slack.com/triggers/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
id: notify-slack
timeout: 600s
options:
logging: CLOUD_LOGGING_ONLY
dynamicSubstitutions: true