-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
41 lines (32 loc) · 1.13 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
steps:
#First Clone from Google Cloud Source Repository
- name: 'gcr.io/cloud-builders/git'
args: ['clone','https://github.com/kserge2001/helloworld19.git']
#Build the image
- name: 'gcr.io/cloud-builders/docker'
args: ['build','-t','gcr.io/${_PROJECT}/${_CONTAINERNAME}:${_VERSION}','.']
#Push the image
- name: 'gcr.io/cloud-builders/docker'
args: ['push','gcr.io/${_PROJECT}/${_CONTAINERNAME}:${_VERSION}']
#Update the container image using kubectl set
- name: 'gcr.io/cloud-builders/kubectl'
args:
- 'set'
- 'image'
- 'deployment/${_DEPLOYMENTNAME}'
- '${_CONTAINERNAME}=gcr.io/${_PROJECT}/${_CONTAINERNAME}:${_VERSION}'
env:
- 'CLOUDSDK_COMPUTE_ZONE=${_ZONE}'
- 'CLOUDSDK_CONTAINER_CLUSTER=${_GKE_CLUSTER}'
substitutions:
#GCP Specific configuration. Please DON'T change anything
_PROJECT: cloud-302913
_ZONE: us-central1-c
_GKE_CLUSTER: cluster-class
#Repository Specific configuration. DevOps can change this settings
_DEPLOYMENTNAME: app-dev2
_CONTAINERNAME: app-dev2
# Developers ONLY change
_VERSION: v3.0
options:
substitution_option: 'ALLOW_LOOSE'