-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
47 lines (43 loc) · 1.39 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
42
43
44
45
46
47
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ["build", "-t", "us.gcr.io/ompldr/bitcoind:$REVISION_ID", "."]
- name: 'gcr.io/cloud-builders/docker'
args: ["tag", "us.gcr.io/ompldr/bitcoind:$REVISION_ID", "us.gcr.io/ompldr/bitcoind:latest"]
- name: 'gcr.io/cloud-builders/docker'
args: ["push", "us.gcr.io/ompldr/bitcoind:$REVISION_ID"]
- name: 'gcr.io/cloud-builders/docker'
args: ["push", "us.gcr.io/ompldr/bitcoind:latest"]
# Start deployment in us-east4
- name: 'gcr.io/cloud-builders/kubectl'
args:
- patch
- statefulset
- bitcoind
- --type=json
- '-p=[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"us.gcr.io/ompldr/bitcoind:$REVISION_ID"}]'
env:
- 'CLOUDSDK_COMPUTE_ZONE=us-east4-a'
- 'CLOUDSDK_CONTAINER_CLUSTER=ompldr-us-east4'
# Wait for previous deployments to complete
- name: 'gcr.io/cloud-builders/kubectl'
args:
- rollout
- status
- sts/bitcoind
# Clear old kubectl creds
- name: 'gcr.io/cloud-builders/kubectl'
entrypoint: 'bash'
args: ['-c',
'rm -rf ~/.kube'
]
# Start deployment in us-west1
- name: 'gcr.io/cloud-builders/kubectl'
args:
- patch
- statefulset
- bitcoind
- --type=json
- '-p=[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"us.gcr.io/ompldr/bitcoind:$REVISION_ID"}]'
env:
- 'CLOUDSDK_COMPUTE_ZONE=us-west1-a'
- 'CLOUDSDK_CONTAINER_CLUSTER=ompldr-us-west1'