-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
62 lines (53 loc) · 1.14 KB
/
Jenkinsfile
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
pipeline {
environment {
registry = "nileshbhadana/parse-server"
registryCredential = 'dockerhub_id_nilesh'
dockerImage = ''
NAMESPACE= "parseapp"
}
agent any
stages {
stage('Cloning our Git') {
steps {
git "https://github.com/nileshbhadana/Parse-server-K8s.git"
}
}
stage('Building our image') {
steps{
script {
dockerImage = docker.build(registry + ":$BUILD_NUMBER",'-f ./deploy/docker/Dockerfile .')
}
}
}
stage('Deploy our image') {
steps{
script {
docker.withRegistry( '', registryCredential ) {
dockerImage.push()
}
}
}
}
stage('Cleaning up') {
steps{
sh ""
}
}
stage('helm list') {
steps{
sh "helm ls"
}
}
stage('Deployment') {
steps{
sh "helm upgrade --install --atomic --wait --timeout 300 mongo ./deploy/helm/mongo-db/ --namespace ${NAMESPACE}"
sh "helm upgrade --install --atomic --wait --timeout 300 parse-server ./deploy/helm/parse-server/ --set image.tag=${BUILD_NUMBER},image.repository=${registry} --namespace ${NAMESPACE}"
}
}
stage('Image Rollout'){
steps{
sh ("kubectl rollout status deployment/parse-server -n ${NAMESPACE}")
}
}
}
}