forked from RAMKIDEVOPS/CI-with-Jenkins-in-AWS-Demo
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcloudbuild.yaml
41 lines (33 loc) · 1.21 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/cooldsachin/CI-with-Jenkins-in-AWS-Demo.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: parabolic-rope-278721
_ZONE: southamerica-east1-c
_GKE_CLUSTER: kubernetes-cluster
#Repository Specific configuration. DevOps can change this settings
_DEPLOYMENTNAME: devops-demo
_CONTAINERNAME: devops-demo
_REPO_NAME: CI-with-Jenkins-in-AWS-Demo
# Developers ONLY change
_VERSION: v1.0
options:
substitution_option: 'ALLOW_LOOSE'