-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
111 lines (102 loc) · 3.04 KB
/
Copy pathcloudbuild.yaml
File metadata and controls
111 lines (102 loc) · 3.04 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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
steps:
- name: 'gcr.io/cloud-builders/docker'
id: BUILD_INGRESS
waitFor: [ '-' ]
args:
[
'build', '-t', '${_IMAGE_INGRESS}',
'-f', './Dockerfile.ingress-gcp',
'--network=cloudbuild',
'--platform', 'linux/amd64',
'--build-arg', 'OBSERVABLE_TELEMETRY_DISABLE=${_OBSERVABLE_TELEMETRY_DISABLE}',
'.'
]
- name: 'gcr.io/cloud-builders/docker'
id: BUILD_BACKEND
waitFor: [ '-' ]
args:
[
'build', '-t', '${_IMAGE_BACKEND}',
'-f', './Dockerfile.backend',
'--network=cloudbuild',
'--platform', 'linux/amd64',
'.'
]
- name: 'gcr.io/cloud-builders/docker'
id: BUILD_VALIDATOR
waitFor: [ '-' ]
args:
[
'build', '-t', '${_IMAGE_VALIDATOR}',
'-f', './Dockerfile.validator-iap',
'--network=cloudbuild',
'--platform', 'linux/amd64',
'.'
]
- name: 'gcr.io/cloud-builders/docker'
id: PUSH_INGRESS
waitFor: [ 'BUILD_INGRESS' ]
args:
[
'push', '${_IMAGE_INGRESS}'
]
- name: 'gcr.io/cloud-builders/docker'
id: PUSH_BACKEND
waitFor: [ 'BUILD_BACKEND' ]
args:
[
'push', '${_IMAGE_BACKEND}'
]
- name: 'gcr.io/cloud-builders/docker'
id: PUSH_VALIDATOR
waitFor: [ 'BUILD_VALIDATOR' ]
args:
[
'push', '${_IMAGE_VALIDATOR}'
]
- name: 'alpine'
id: SET_SERVICE
env:
- 'SERVICE=${_SERVICE}'
- 'IMAGE_INGRESS=${_IMAGE_INGRESS}'
- 'PORT_INGRESS=${_PORT_INGRESS}'
- 'IMAGE_BACKEND=${_IMAGE_BACKEND}'
- 'PORT_BACKEND=${_PORT_BACKEND}'
- 'IMAGE_VALIDATOR=${_IMAGE_VALIDATOR}'
- 'PORT_VALIDATOR=${_PORT_VALIDATOR}'
- 'GCP_IAP_JWT_AUDIENCE=${_GCP_IAP_JWT_AUDIENCE}'
script: |
sed -i s@%SERVICE%@${SERVICE}@g run-service.yaml
sed -i s@%IMAGE_INGRESS%@${IMAGE_INGRESS}@g run-service.yaml
sed -i s@%PORT_INGRESS%@${PORT_INGRESS}@g run-service.yaml
sed -i s@%IMAGE_BACKEND%@${IMAGE_BACKEND}@g run-service.yaml
sed -i s@%PORT_BACKEND%@${PORT_BACKEND}@g run-service.yaml
sed -i s@%IMAGE_VALIDATOR%@${IMAGE_VALIDATOR}@g run-service.yaml
sed -i s@%PORT_VALIDATOR%@${PORT_VALIDATOR}@g run-service.yaml
sed -i s@%GCP_IAP_JWT_AUDIENCE%@${GCP_IAP_JWT_AUDIENCE}@g run-service.yaml
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
id: RUN_SERVICE
entrypoint: 'gcloud'
args:
[
'run', 'services', 'replace', 'run-service.yaml',
'--region', '${LOCATION}',
]
substitutions:
_SERVICE: "ob-app-sidecar"
_REPO: "ob-app-sidecar-repo"
_REGISTRY: "${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${_REPO}"
_PORT_INGRESS: "8080"
_NAME_INGRESS: "ob-app-sidecar-ingress"
_IMAGE_INGRESS: "${_REGISTRY}/${_NAME_INGRESS}:${COMMIT_SHA}"
_PORT_BACKEND: "8082"
_NAME_BACKEND: "ob-app-sidecar-backend"
_IMAGE_BACKEND: "${_REGISTRY}/${_NAME_BACKEND}:${COMMIT_SHA}"
_PORT_VALIDATOR: "8081"
_NAME_VALIDATOR: "ob-app-sidecar-validator"
_IMAGE_VALIDATOR: "${_REGISTRY}/${_NAME_VALIDATOR}:${COMMIT_SHA}"
_OBSERVABLE_TELEMETRY_DISABLE: "false"
_GCP_IAP_JWT_AUDIENCE: "audience_string_for_IAP_JWT_validation"
options:
dynamic_substitutions: true
logging: CLOUD_LOGGING_ONLY