-
Notifications
You must be signed in to change notification settings - Fork 14
/
cloudbuild.prod.yaml
57 lines (54 loc) · 1.48 KB
/
cloudbuild.prod.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
49
50
51
52
53
54
55
56
57
# See list of built-in substitutions at
# https://cloud.google.com/container-builder/docs/configuring-builds/substitute-variable-values
substitutions:
_CLOUDSDK_COMPUTE_REGION: us-central1
_CLOUDSDK_CONTAINER_CLUSTER: prod-gke
_ENVIRONMENT: prod
_GCLOUD_PROJECT: etcd-io
_HELM_CHART_GIT_REPO: https://github.com/etcd-io/discovery.etcd.io.git
_HELM_CHART_GIT_BRANCH: master
_HELM_CHART_PATH: kubernetes/helm
_K8S_NAMESPACE: discoveryserver
_REPO_NAME: discoveryserver
steps:
- name: 'gcr.io/cloud-builders/git' # Clone Helm Chart repo where chart lives
args: ['clone', '${_HELM_CHART_GIT_REPO}', '/helm']
volumes:
- name: 'helm'
path: '/helm'
- name: 'gcr.io/cloud-builders/git'
args: ['checkout', '${_HELM_CHART_GIT_BRANCH}']
dir: '/helm'
volumes:
- name: 'helm'
path: '/helm'
- name: 'gcr.io/cloudkite-public/gcloud-helm3:20191117' # Deploy helm chart
args:
- /usr/local/bin/helm
- upgrade
- --atomic
- --wait
- --timeout
- "900s"
- --install
- --namespace
- ${_K8S_NAMESPACE}
- --values
- ${_HELM_CHART_PATH}/${_REPO_NAME}/${_ENVIRONMENT}.values.yaml
- --debug
- --set
- image.tag=${COMMIT_SHA}
- ${_REPO_NAME}
- ${_HELM_CHART_PATH}/${_REPO_NAME}
dir: '/helm'
env:
- 'GCLOUD_PROJECT=${_GCLOUD_PROJECT}'
- 'CLOUDSDK_COMPUTE_REGION=${_CLOUDSDK_COMPUTE_REGION}'
- 'CLOUDSDK_CONTAINER_CLUSTER=${_CLOUDSDK_CONTAINER_CLUSTER}'
volumes:
- name: 'helm'
path: '/helm'
timeout: 900s
tags:
- ${_REPO_NAME}
- ${_ENVIRONMENT}