-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
38 lines (33 loc) · 1.07 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
# $PROJECT_ID resolves to the current project's ID
# ${_SERVICE} must be provided via --substitutions=_SERVICE=my-service-name argument.
# gcloud builds submit --substitutions _SERVICE=service-name
# See the link below for details on setting default values for substitutions
# https://cloud.google.com/build/docs/configuring-builds/substitute-variable-values
steps:
- id: docker-build-push-service
waitFor: ['-']
name: gcr.io/cloud-builders/docker
entrypoint: bash
args:
- -c
- |
docker build -t gcr.io/$PROJECT_ID/${_SERVICE} . && \
docker push gcr.io/$PROJECT_ID/${_SERVICE}
- id: gcloud-run-deploy-backend-processor
waitFor: ['docker-build-push-service']
name: gcr.io/google.com/cloudsdktool/cloud-sdk
entrypoint: bash
args:
- -c
- |
gcloud run deploy ${_SERVICE} \
--project $PROJECT_ID \
--image gcr.io/$PROJECT_ID/${_SERVICE} \
--timeout 15m \
--region us-east4 \
--platform managed \
--min-instances 0 \
--max-instances 5 \
--allow-unauthenticated
substitutions:
_SERVICE: dfcx-stte-example