-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcloudbuild.yml
36 lines (31 loc) · 1.28 KB
/
cloudbuild.yml
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
steps:
- name: 'gcr.io/cloud-builders/docker'
id: 'Build Image'
args: ['build', '-t', 'asia-northeast1-docker.pkg.dev/${PROJECT_ID}/test-cluster-repo/test-web-image:$SHORT_SHA', './docker']
- name: 'gcr.io/cloud-builders/docker'
id: 'Push to GCR'
args: ['push', 'asia-northeast1-docker.pkg.dev/${PROJECT_ID}/test-cluster-repo/test-web-image:$SHORT_SHA']
- name: 'gcr.io/cloud-builders/gcloud'
id: 'Edit Deployment Manifest'
entrypoint: '/bin/sh'
args:
- '-c'
- sed -i -e 's/COMMIT_SHA/${SHORT_SHA}/' manifest/deployment.yaml
- name: 'gcr.io/cloud-builders/kubectl'
id: 'Apply Deployment Manifest'
args: ['apply', '-f', 'manifest/deployment.yaml']
env:
- 'CLOUDSDK_COMPUTE_REGION=asia-northeast1'
- 'CLOUDSDK_CONTAINER_CLUSTER=test-cluster-autopilot'
- name: 'gcr.io/cloud-builders/kubectl'
id: 'Apply Service Manifest'
args: ['apply', '-f', 'manifest/service.yaml']
env:
- 'CLOUDSDK_COMPUTE_REGION=asia-northeast1'
- 'CLOUDSDK_CONTAINER_CLUSTER=test-cluster-autopilot'
- name: 'gcr.io/cloud-builders/kubectl'
id: 'Apply HPA Manifest'
args: ['apply', '-f', 'manifest/hpa.yaml']
env:
- 'CLOUDSDK_COMPUTE_REGION=asia-northeast1'
- 'CLOUDSDK_CONTAINER_CLUSTER=test-cluster-autopilot'