-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathJenkinsfile
65 lines (58 loc) · 1.55 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
63
64
65
@Library('jenkins-shared-library@release') _
pipeline {
agent {
kubernetes(agents().helm().startContainers())
}
options {
skipStagesAfterUnstable()
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '28'))
timeout(time: 1, unit: 'HOURS')
timestamps()
}
stages {
stage("Helm Lint") {
steps {
helmLint()
}
}
stage("Helm Test") {
steps {
container("helm") {
sh 'helm unittest -o test-results.xml -t junit -3 $(find tests/**/test.yaml | sed \'s:tests/:-f tests/:g\') .'
}
}
post {
always {
junit 'test-results.xml'
}
}
}
stage("Helm Push") {
when {
not {
branch 'master'
}
}
steps {
script {
def version = "3.0.0-${GIT_COMMIT}"
currentBuild.displayName = version
helmPush tenant: 'shared', version: version
}
}
}
stage("Helm Release") {
when {
branch 'master'
}
steps {
script {
def chart = readYaml file: 'Chart.yaml'
currentBuild.displayName = chart.version
helmPush tenant: 'shared'
}
}
}
}
}