-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
41 lines (41 loc) · 1.03 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
steps:
#step 1
- name: "gcr.io/cloud-builders/docker"
entrypoint: "bash"
args: ["-c", "docker pull gcr.io/kube-assimilate/goapp:latest || exit 0"]
#step 2
- name: gcr.io/cloud-builders/docker
args:
[
"build",
"-t",
"gcr.io/kube-assimilate/goapp:$TAG_NAME",
"-t",
"gcr.io/kube-assimilate/goapp:latest",
".",
]
#step 3
- name: "gcr.io/cloud-builders/kubectl"
args: ["apply", "-f", "k8s/"]
env:
- "CLOUDSDK_COMPUTE_ZONE=asia-south1-a"
- "CLOUDSDK_CONTAINER_CLUSTER=abhay-cluster"
#step 4
- name: "gcr.io/cloud-builders/kubectl"
args:
[
"set",
"image",
"deployment",
"goapp",
"goapp=gcr.io/kube-assimilate/goapp:$TAG_NAME",
]
env:
- "CLOUDSDK_COMPUTE_ZONE=asia-south1-a"
- "CLOUDSDK_CONTAINER_CLUSTER=abhay-cluster"
# push images to Google Container Registry with tags
images:
[
"gcr.io/kube-assimilate/goapp:$TAG_NAME",
"gcr.io/kube-assimilate/goapp:latest",
]