-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
38 lines (38 loc) · 1.13 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
steps:
- name: gradle:7.1.1-jdk8
entrypoint: gradle
args: ["assemble"]
- id: 'pull image'
name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: [
'-c',
'docker pull gcr.io/$PROJECT_ID/contactservice:latest || exit 0'
]
- name: gcr.io/cloud-builders/docker
args: [ "build",
"-t",
"gcr.io/$PROJECT_ID/contactservice:$COMMIT_SHA",
'-t',
'gcr.io/$PROJECT_ID/contactservice:latest',
"." ]
- id: 'deploy'
name: 'gcr.io/cloud-builders/kubectl'
args: [ 'apply', '-f', 'k8s/' ]
env:
- 'CLOUDSDK_COMPUTE_ZONE=us-central1-c'
- 'CLOUDSDK_CONTAINER_CLUSTER=rajutechies-cluster'
- name: 'gcr.io/cloud-builders/kubectl'
args: [
'set',
'image',
'deployment',
'contactservice',
'contactservice=gcr.io/$PROJECT_ID/contactservice:$COMMIT_SHA'
]
env:
- 'CLOUDSDK_COMPUTE_ZONE=us-central1-c'
- 'CLOUDSDK_CONTAINER_CLUSTER=rajutechies-cluster'
tags: ['master']
images: ["gcr.io/$PROJECT_ID/contactservice:$COMMIT_SHA",
'gcr.io/$PROJECT_ID/contactservice:latest']