-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
50 lines (50 loc) · 1.48 KB
/
cloudbuild.yaml
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
steps:
- name: gcr.io/cloud-builders/docker
env:
- DOCKER_BUILDKIT=1
args:
- build
- '--no-cache'
- '-t'
- asia-southeast2-docker.pkg.dev/$PROJECT_ID/tutortoise/backend:$COMMIT_SHA
- .
- '-f'
- Dockerfile
id: Build
- name: gcr.io/cloud-builders/docker
args:
- tag
- asia-southeast2-docker.pkg.dev/$PROJECT_ID/tutortoise/backend:$COMMIT_SHA
- 'asia-southeast2-docker.pkg.dev/$PROJECT_ID/tutortoise/backend:latest'
id: Tag
- name: gcr.io/cloud-builders/docker
args:
- push
- asia-southeast2-docker.pkg.dev/$PROJECT_ID/tutortoise/backend
- '--all-tags'
id: Push
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
args:
- run
- services
- update
- tutortoise-backend
- '--platform=managed'
- '--image=asia-southeast2-docker.pkg.dev/$PROJECT_ID/tutortoise/backend:latest'
- '--labels=managed-by=gcp-cloud-build-deploy-cloud-run,commit-sha=$COMMIT_SHA,gcb-build-id=$BUILD_ID,gcb-trigger-id=$_TRIGGER_ID'
- '--region=asia-southeast2'
- '--quiet'
id: Deploy
entrypoint: gcloud
timeout: 600s
images:
- 'asia-southeast2-docker.pkg.dev/$PROJECT_ID/tutortoise/backend:$COMMIT_SHA'
options:
substitutionOption: ALLOW_LOOSE
logging: CLOUD_LOGGING_ONLY
substitutions:
_TRIGGER_ID: f529fdff-9444-48ed-b06b-5ecc13d39cb5
tags:
- gcp-cloud-build-deploy-cloud-run
- gcp-cloud-build-deploy-cloud-run-managed
- tutortoise-backend