-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
34 lines (31 loc) · 1.09 KB
/
Copy pathcloudbuild.yaml
File metadata and controls
34 lines (31 loc) · 1.09 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
substitutions:
_DEPLOY_REGION: us-central1
_APP_VERSION: latest
_BUILD_VERSION: latest
_GCR_HOSTNAME: us.gcr.io
_SERVICE_NAME: sfkit-react
_SERVICE_CONFIG_NAME: ${_SERVICE_NAME}
_SERVICE_REGION: us-central1
_SERVICE_ACCOUNT: ${_SERVICE_NAME}-sa@${PROJECT_ID}.iam.gserviceaccount.com
_IMAGE: ${_GCR_HOSTNAME}/${PROJECT_ID}/${_SERVICE_NAME}
options:
logging: CLOUD_LOGGING_ONLY
automapSubstitutions: true
steps:
- name: gcr.io/cloud-builders/docker
script: >-
docker buildx create --use --driver docker-container &&
docker buildx build --push -t $_IMAGE:$SHORT_SHA
--cache-from type=registry,ref=$_IMAGE:cache
--cache-to type=registry,ref=$_IMAGE:cache,mode=max
--build-arg APP_VERSION=$SHORT_SHA
--build-arg BUILD_VERSION=$SHORT_SHA .
--build-arg SERVICE_NAME=$_SERVICE_CONFIG_NAME
- name: gcr.io/google.com/cloudsdktool/cloud-sdk:alpine
script: >-
gcloud run deploy $_SERVICE_NAME
--image $_IMAGE:$SHORT_SHA
--region $_SERVICE_REGION
--service-account $_SERVICE_ACCOUNT
--min-instances 1
--max-instances 5