-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
51 lines (46 loc) · 1.45 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
steps:
- name: "gcr.io/cloud-builders/docker"
args:
[
"build",
"-t",
"${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/${_SERVICE_NAME}:${TAG_NAME}",
".",
]
- name: "gcr.io/cloud-builders/docker"
args:
[
"push",
"${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/${_SERVICE_NAME}:${TAG_NAME}",
]
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
entrypoint: gcloud
args:
[
"run",
"deploy",
"${_SERVICE_NAME}",
"--image",
"${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/${_SERVICE_NAME}:${TAG_NAME}",
"--set-env-vars",
"ENVIRONMENT=${_ENVIRONMENT},ALLOW_ORIGIN=${_ALLOW_ORIGIN},TRUSTED_PROXY=${_TRUSTED_PROXY},GOOGLE_CLOUD_PROJECT_ID=${PROJECT_ID}",
"--region",
"${_REGION}",
"--service-account",
"${_SERVICE_ACCOUNT}@${PROJECT_ID}.iam.gserviceaccount.com",
"--max-instances",
"${_MAX_INSTANCES}",
]
images:
- "${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/${_SERVICE_NAME}:${TAG_NAME}"
substitutions:
_SERVICE_NAME: knodeledge-api
_REGION: us-central1
_REPOSITORY: knodeledge-api-repository
_SERVICE_ACCOUNT: knodeledge-api-identity
_MAX_INSTANCES: "1"
_ENVIRONMENT: <TRIGGER WILL REPLACE THIS>
_ALLOW_ORIGIN: <TRIGGER WILL REPLACE THIS>
_TRUSTED_PROXY: <TRIGGER WILL REPLACE THIS>
options:
logging: CLOUD_LOGGING_ONLY