-
Notifications
You must be signed in to change notification settings - Fork 46
/
Jenkinsfile
49 lines (48 loc) · 950 Bytes
/
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
import java.text.SimpleDateFormat
pipeline {
options {
buildDiscarder logRotator(numToKeepStr: '5')
disableConcurrentBuilds()
}
agent {
kubernetes {
cloud "kubernetes"
label "prod"
serviceAccount "build"
yamlFile "KubernetesPod.yaml"
}
}
environment {
cmAddr = "cm.34.210.146.155.nip.io"
}
stages {
stage("deploy") {
when {
branch "master"
}
steps {
container("helm") {
sh "helm repo add chartmuseum http://${cmAddr}"
sh "helm repo update"
sh "helm dependency update helm"
sh "helm upgrade -i prod helm --namespace prod --force"
}
}
}
stage("test") {
when {
branch "master"
}
steps {
echo "Testing..."
}
post {
failure {
container("helm") {
sh "helm rollback prod 0"
}
}
}
}
}
}