generated from dragonfish/node-ts-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
47 lines (42 loc) · 1.73 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
substitutions:
_SERVICE_NAME: trip-service
steps:
# Step 1: Generate from Protobuf
- name: bufbuild/buf@sha256:c34c81ac26044490a10fb5009eb618640834b9048f38d4717538421c6a25e4d7
args:
- generate
- --include-imports
# Step 2: Build a Docker image
- name: gcr.io/cloud-builders/docker@sha256:47811a1b1d9ea56172bd4758c16c9aff98f7a8fcfadf5a8a59d0bf8669e70014
args:
- build
- -t
- asia-south2-docker.pkg.dev/$PROJECT_ID/docker-registry/$_SERVICE_NAME:$COMMIT_SHA
- -t
- asia-south2-docker.pkg.dev/$PROJECT_ID/docker-registry/$_SERVICE_NAME:$BRANCH_NAME
- -t
- asia-south2-docker.pkg.dev/$PROJECT_ID/docker-registry/$_SERVICE_NAME:latest
- .
# Step 3: Push a Docker image
- name: gcr.io/cloud-builders/docker@sha256:47811a1b1d9ea56172bd4758c16c9aff98f7a8fcfadf5a8a59d0bf8669e70014
args:
- push
- asia-south2-docker.pkg.dev/$PROJECT_ID/docker-registry/$_SERVICE_NAME:$COMMIT_SHA
# Step 4: Push the new Cloud Run revision
- name: gcr.io/google.com/cloudsdktool/cloud-sdk@sha256:3a24ff5f089d9ce3627306873ef1e1061488a63ae12c0bd0b5c24ec5ee594798
entrypoint: gcloud
args:
- run
- deploy
- $_SERVICE_NAME
- --image
- asia-south2-docker.pkg.dev/$PROJECT_ID/docker-registry/$_SERVICE_NAME:$COMMIT_SHA
- --region=asia-south2
- --allow-unauthenticated
- --set-env-vars=PROJECT_ID=$PROJECT_ID,FIREBASE_DATABASE_URL=$_FIREBASE_DATABASE_URL,NOTIFICATION_SERVICE_URL=$_NOTIFICATION_SERVICE_URL,LOG_DEBUG=$_LOG_DEBUG
- --set-secrets=OTP_SECRET=$_OTP_SECRET_ID:latest
- --max-instances=10
- --port=50051
- --use-http2
images:
- asia-south2-docker.pkg.dev/$PROJECT_ID/docker-registry/$_SERVICE_NAME:$COMMIT_SHA