-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
36 lines (36 loc) · 981 Bytes
/
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
steps:
- name: 'gcr.io/cloud-builders/npm'
args: ['install']
- name: 'gcr.io/cloud-builders/npm'
args: ['run', 'test']
- name: 'gcr.io/cloud-builders/docker'
args:
- build
- '--build-arg'
- 'buildtime_variable=$_NODE_ENV'
- '-t'
- gcr.io/$PROJECT_ID/$REPO_NAME:$BUILD_ID
- '.'
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/$REPO_NAME:$BUILD_ID']
- name: 'gcr.io/cloud-builders/kubectl'
id: deployment
args:
- apply
- -f
- deployment.yaml
env:
- 'CLOUDSDK_COMPUTE_ZONE=$_CLUSTER_ZONE'
- 'CLOUDSDK_CONTAINER_CLUSTER=$_CLUSTER_NAME'
- name: 'gcr.io/cloud-builders/kubectl'
waitFor:
- deployment
args:
- set
- image
- deployment
- $_DEPLOYMENT
- $_DEPLOYMENT=gcr.io/$PROJECT_ID/$REPO_NAME:$BUILD_ID
env:
- 'CLOUDSDK_COMPUTE_ZONE=$_CLUSTER_ZONE'
- 'CLOUDSDK_CONTAINER_CLUSTER=$_CLUSTER_NAME'