forked from gothinkster/react-redux-realworld-example-app
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathcloudbuild.yaml
39 lines (39 loc) · 1.15 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
steps:
- name: 'gcr.io/cloud-builders/docker'
args:
- 'pull'
- '$_REPO/$PROJECT_ID/$_PROJECT:latest'
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '--cache-from'
- '$_REPO/$PROJECT_ID/$_PROJECT:latest'
- '.'
- '-t'
- '$_REPO/$PROJECT_ID/$_PROJECT:$SHORT_SHA'
- '-t'
- '$_REPO/$PROJECT_ID/$_PROJECT:latest'
- name: 'gcr.io/cloud-builders/docker'
args:
- 'push'
- '$_REPO/$PROJECT_ID/$_PROJECT:$SHORT_SHA'
- name: 'gcr.io/cloud-builders/docker'
args:
- 'push'
- '$_REPO/$PROJECT_ID/$_PROJECT:latest'
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |
gcloud components install kubectl
gcloud container clusters get-credentials $_CLUSTER --zone $_ZONE
kubectl set image deployment $_PROJECT $_PROJECT=$_REPO/$PROJECT_ID/$_PROJECT:$SHORT_SHA --namespace=$_NAMESPACE --record
kubectl rollout status deployment $_PROJECT --namespace=$_NAMESPACE
substitutions:
_PROJECT: react-redux
_REPO: gcr.io
_ZONE: us-central1-a
_CLUSTER: standard-cluster-1
_NODE_ENV: production
_NAMESPACE: default