-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
39 lines (38 loc) · 1.09 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
substitutions:
_NAME: nodeserver
_REGION: us-central1
_DBPASS: dbpass
steps:
#step 1
- name: "gcr.io/cloud-builders/docker"
args: ["build", "-t", "gcr.io/$PROJECT_ID/$_NAME:latest", "-t", "gcr.io/$PROJECT_ID/$_NAME:$COMMIT_SHA", "."]
#step 2
- name: gcr.io/cloud-builders/docker
args:
[
"push",
"gcr.io/$PROJECT_ID/$_NAME:latest"
]
#step 3
# Configure a kubeclt workspace for this project
- name: gcr.io/cloud-builders/kubectl
args:
- cluster-info
env:
- CLOUDSDK_COMPUTE_ZONE=$_REGION
- CLOUDSDK_CONTAINER_CLUSTER=$_NAME
- KUBECONFIG=/workspace/.kube/config
#step 4
- name: "gcr.io/$PROJECT_ID/helm"
entrypoint: 'bash'
args: ['-c', 'helm upgrade --install $_NAME chart/nodeserver --set password.databasePassword=$_DBPASS']
env:
- KUBECONFIG=/workspace/.kube/config
- CLOUDSDK_COMPUTE_ZONE=$_REGION
- CLOUDSDK_CONTAINER_CLUSTER=$_NAME
# push images to Google Container Registry with tags
images:
[
"gcr.io/$PROJECT_ID/$_NAME:$COMMIT_SHA",
"gcr.io/$PROJECT_ID/$_NAME:latest",
]