-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
58 lines (51 loc) · 1.13 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
pipeline {
agent none
/*** PIPELINE ENVIRONMENT ***/
environment {
BASE_PATH = 'base'
OVERLAYS_PATH = 'overlays'
SLAVES_TEMPLATES_PATH = 'slaves'
}
/*** STAGES ***/
stages {
/** VERIFY **/
stage('verify') {
when {
// only for the master branch
beforeAgent true
branch 'master'
}
agent {
// execute on the 'kubectl slave' pod
kubernetes {
defaultContainer 'kubectl'
yamlFile "${SLAVES_TEMPLATES_PATH}/kubectl-slave.yaml"
}
}
steps {
sh """
kubectl apply -k ${env.BASE_PATH} --dry-run -o yaml
for d in \$(find "${env.OVERLAYS_PATH}" -mindepth 1 -maxdepth 1 -type d); do kubectl apply -k \${d} --dry-run -o yaml; done
"""
}
}
}
// /*** POST-EXECUTION ***/
// post {
// success {
// node('ci-jenkins-slave') {
// echo 'SUCCESS'
// }
// }
// failure {
// node('ci-jenkins-slave') {
// echo 'FAILURE'
// }
// }
// always {
// node('ci-jenkins-slave') {
// echo 'ENDED'
// }
// }
// }
}