-
Notifications
You must be signed in to change notification settings - Fork 4
/
cloudbuild.yaml
64 lines (63 loc) · 1.98 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
steps:
- name: gcr.io/cloud-builders/docker
args:
- build
- '--no-cache'
- '-t'
- >-
$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
- .
- '-f'
- Dockerfile
- '--build-arg'
- APP_ENV=$_APP_ENV
- '--build-arg'
- APP_VERSION=$COMMIT_SHA
- '--build-arg'
- CLIENT_URL=$_CLIENT_URL
- '--build-arg'
- BUGSNAG_API_KEY=$_BUGSNAG_API_KEY
id: Build
- name: gcr.io/cloud-builders/docker
args:
- push
- >-
$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
id: Push
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
args:
- run
- deploy
- $_SERVICE_NAME
- '--platform=managed'
- '--image=$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$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'
- '--region=$_DEPLOY_REGION'
- '--allow-unauthenticated'
- '--cpu-boost'
- '--memory=1024Mi'
- '--min-instances=3'
- '--max-instances=10'
- '--update-env-vars=APP_VERSION=$COMMIT_SHA'
- '--update-secrets=GATEWAY_API_KEY=$_GATEWAY_API_KEY_SECRET'
- '--quiet'
id: Deploy
entrypoint: gcloud
images:
- >-
$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA
options:
substitutionOption: ALLOW_LOOSE
substitutions:
_DEPLOY_REGION: us-central1
_AR_HOSTNAME: us-central1-docker.pkg.dev
_PLATFORM: managed
_SERVICE_NAME: ud-me-stag
_BUGSNAG_API_KEY: 4a72fb23d3ddc00054db744c3006f0cd
_GATEWAY_API_KEY_SECRET: kong_consumer_stag_ud-me:1
_GCS_STORAGE_BUCKET_FOR_CLOUDBUILD: "ud-staging-cloudbuild-logs"
logsBucket: "$_GCS_STORAGE_BUCKET_FOR_CLOUDBUILD"
tags:
- gcp-cloud-build-deploy-cloud-run
- gcp-cloud-build-deploy-cloud-run-managed
- ud-me-stag