-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.staging.yaml
36 lines (32 loc) · 1.1 KB
/
cloudbuild.staging.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
#-----------------------------------------
# CloudBuild Pipeline for Staging CloudRun
#-----------------------------------------
steps:
# Docker Build Image
- name: gcr.io/cloud-builders/docker
id : BUILD
args: ['build', '-t', '$_SERVICE_IMAGE', '.', '-f', 'Dockerfile']
# Docker Push Image to Artifact Registry
- name: gcr.io/cloud-builders/docker
id : PUSH
args: ['push', '$_SERVICE_IMAGE']
# Docker Deploy image to Cloud Run
- name: gcr.io/cloud-builders/gcloud
id : DEPLOY
args:
- run
- services
- update
- $_SERVICE_NAME
- --project=$_SERVICE_PROJECT
- --region=$_SERVICE_REGION
- --image=$_SERVICE_IMAGE
images: # Display the image in the build results - Build Artifacts
- $_SERVICE_IMAGE
substitutions:
_SERVICE_IMAGE : northamerica-northeast1-docker.pkg.dev/${PROJECT_ID}/${_DOCKER_REGISTRY}/${_DOCKER_IMAGENAME}:${SHORT_SHA}
_SERVICE_REGION : northamerica-northeast1
_SERVICE_PROJECT : stage-337010
_SERVICE_NAME : my-docker-app-staging
_DOCKER_REGISTRY : test-docker-repo
_DOCKER_IMAGENAME : webapp-staging