-
Notifications
You must be signed in to change notification settings - Fork 2
/
cloudbuild.yaml
35 lines (35 loc) · 1.06 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
# requires a substite variable of _APP to build
# e.g. ea, sepa, etc
steps:
# compile binary using make, then dockerise
- name: "golang"
args: ["make", "${_APP}"]
- name: "gcr.io/cloud-builders/docker"
args:
["build", "-t", "eu.gcr.io/$PROJECT_ID/gauge/${_APP}:${COMMIT_SHA}", "."]
- name: "gcr.io/cloud-builders/docker"
args:
[
"tag",
"eu.gcr.io/$PROJECT_ID/gauge/${_APP}:${COMMIT_SHA}",
"eu.gcr.io/$PROJECT_ID/gauge/${_APP}:latest",
]
# update k8s deployment to rollout new image
- name: "gcr.io/cloud-builders/docker"
args: ["push", "eu.gcr.io/$PROJECT_ID/gauge/${_APP}:${COMMIT_SHA}"]
- name: gcr.io/cloud-builders/kubectl
args:
[
"set",
"image",
"deployment/${_APP}",
"${_APP}=eu.gcr.io/$PROJECT_ID/gauge/${_APP}:${COMMIT_SHA}",
]
env:
[
"CLOUDSDK_COMPUTE_ZONE=europe-west2-b",
"CLOUDSDK_CONTAINER_CLUSTER=prod",
]
images:
- "eu.gcr.io/$PROJECT_ID/gauge/${_APP}:${COMMIT_SHA}"
- "eu.gcr.io/$PROJECT_ID/gauge/${_APP}:latest"