-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
56 lines (56 loc) · 1.67 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
51
52
53
54
55
56
steps:
- name: gcr.io/cloud-builders/docker
args:
- '-c'
- >-
docker pull
us.gcr.io/$PROJECT_ID/$REPO_NAME/app@sha256:b5d0989808ffa41d19ebbe648a9b48918e673498967ea7fd2b0164a3b9a837d7
|| exit 0
entrypoint: bash
- name: gcr.io/cloud-builders/docker
args:
- build
- '-t'
- '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
- .
- '--cache-from'
- >-
us.gcr.io/$PROJECT_ID/$REPO_NAME/app@sha256:b5d0989808ffa41d19ebbe648a9b48918e673498967ea7fd2b0164a3b9a837d7
- '-f'
- Dockerfile
id: Build
- name: gcr.io/cloud-builders/docker
args:
- push
- '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
id: Push
- name: gcr.io/google.com/cloudsdktool/cloud-sdk
args:
- run
- services
- update
- $_SERVICE_NAME
- '--platform=managed'
- '--image=$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
- >-
--labels=managed-by=gcp-cloud-build-deploy-cloud-run,commit-sha=$COMMIT_SHA,gcb-build-id=$BUILD_ID,gcb-trigger-id=$_TRIGGER_ID,$_LABELS
- '--region=$_DEPLOY_REGION'
- '--quiet'
id: Deploy
entrypoint: gcloud
timeout: 6000s
images:
- '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
options:
substitutionOption: ALLOW_LOOSE
substitutions:
_GCR_HOSTNAME: us.gcr.io
_PLATFORM: managed
_LABELS: gcb-trigger-id=c96c9150-66a3-472f-9993-9ea4ab45f265
_TRIGGER_ID: c96c9150-66a3-472f-9993-9ea4ab45f265
_SERVICE_NAME: app
_DEPLOY_REGION: us-west1
tags:
- gcp-cloud-build-deploy-cloud-run
- gcp-cloud-build-deploy-cloud-run-managed
- app