-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
48 lines (46 loc) · 1.56 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
steps:
- name: gcr.io/cloud-builders/docker
args: [
'build',
'--no-cache',
'--build-arg','PROJECT_ID=${PROJECT_ID}',
'--build-arg','_DEPLOY_REGION=${_DEPLOY_REGION}',
'--build-arg','REPO_NAME=${REPO_NAME}',
'-t','${_DEPLOY_REGION}-docker.pkg.dev/$PROJECT_ID/$REPO_NAME/${_SERVICE_NAME}:$COMMIT_SHA','.',
'-f', 'Dockerfile']
id: Build
- name: gcr.io/cloud-builders/docker
args: [
'push',
'${_DEPLOY_REGION}-docker.pkg.dev/$PROJECT_ID/$REPO_NAME/${_SERVICE_NAME}:$COMMIT_SHA']
id: Push
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
args: [
'run',
'services',
'update',
'$_SERVICE_NAME',
'--platform=managed',
'--image=${_DEPLOY_REGION}-docker.pkg.dev/$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:
- '${_DEPLOY_REGION}-docker.pkg.dev/$PROJECT_ID/$REPO_NAME/${_SERVICE_NAME}:$COMMIT_SHA'
options:
substitutionOption: ALLOW_LOOSE
substitutions:
_SERVICE_NAME: covid19-indicators2
_LABELS: gcb-trigger-id=7475ee4e-ff87-435e-a018-7222d89d5890
_TRIGGER_ID: 7475ee4e-ff87-435e-a018-7222d89d5890
_DEPLOY_REGION: us-west2
_GCR_HOSTNAME: us.gcr.io
_PLATFORM: managed
tags:
- gcp-cloud-build-deploy-cloud-run
- gcp-cloud-build-deploy-cloud-run-managed
- covid19-indicators2