forked from contino/technical-tests-rx2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcloudbuild.yaml
48 lines (44 loc) · 1.25 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
steps:
- name: 'gcr.io/cloud-builders/docker'
id: TestAndBuild
args:
- 'build'
- '-t'
- 'asia.gcr.io/$PROJECT_ID/tech-test2:$SHORT_SHA'
- '--build-arg'
- 'ci_sha=$COMMIT_SHA'
- '--build-arg'
- 'ci_description=pre-interview technical test, CloudBuild does not have commit message?'
- '--build-arg'
- 'ci_version=1.0.0'
- '.'
- name: 'gcr.io/cloud-builders/docker'
id: Tag
args:
- 'tag'
- 'asia.gcr.io/$PROJECT_ID/tech-test2:$SHORT_SHA'
- 'asia.gcr.io/$PROJECT_ID/tech-test2:latest'
- name: 'gcr.io/cloud-builders/docker'
id: Push
args:
- 'push'
- 'asia.gcr.io/$PROJECT_ID/tech-test2'
- name: 'gcr.io/cloud-builders/kubectl'
id: DeployApp
args:
- 'apply'
- '-f'
- '.k8s/app.yaml'
env:
- 'CLOUDSDK_COMPUTE_ZONE=australia-southeast1-c'
- 'CLOUDSDK_CONTAINER_CLUSTER=cloudbuild-cluster1'
- name: 'gcr.io/cloud-builders/kubectl'
id: RollingUpdate
args:
- 'set'
- 'image'
- 'deployment/app-deploy'
- 'app-golang=asia.gcr.io/$PROJECT_ID/tech-test2:$SHORT_SHA'
env:
- 'CLOUDSDK_COMPUTE_ZONE=australia-southeast1-c'
- 'CLOUDSDK_CONTAINER_CLUSTER=cloudbuild-cluster1'