-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgoogle-cloud-deploy.yaml
43 lines (43 loc) · 1.09 KB
/
google-cloud-deploy.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
# Instructions to Google Cloud Build to build and deploy
steps:
# Clone the repo **including submodules** into the 'bwops' directory
- name: 'gcr.io/cloud-builders/git'
id: Clone
args:
- 'clone'
- '--depth'
- '1'
- '--single-branch'
- '-b'
- '$BRANCH_NAME'
- '--recurse-submodules'
- '--shallow-submodules'
- 'https://github.com/Gapminder/big-waffle-ops.git'
- 'bwops'
# Build the container image will be deployed to the service cluster.
- name: 'gcr.io/cloud-builders/docker'
id: Build
args:
- 'build'
- '-f'
- 'bwops/Dockerfile'
- '-t'
- 'eu.gcr.io/$PROJECT_ID/big-waffle-ops:$SHORT_SHA'
- 'bwops'
# Push the image to the registry
- name: 'gcr.io/cloud-builders/docker'
id: Push
args:
- 'push'
- 'eu.gcr.io/$PROJECT_ID/big-waffle-ops:$SHORT_SHA'
# Roll out the new image to the pods in the cluster
- name: 'gcr.io/cloud-builders/kubectl'
id: RollOut
args:
- 'set'
- 'image'
- 'deployment/bigwaffle-ops'
- '*=eu.gcr.io/$PROJECT_ID/big-waffle-ops:$SHORT_SHA'
env:
- 'CLOUDSDK_COMPUTE_ZONE=europe-north1-a'
- 'CLOUDSDK_CONTAINER_CLUSTER=ops-cluster'