2018-09-29 14:52:11 +02:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
kubernetes {
|
|
|
|
label 'helm'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Test') {
|
|
|
|
steps {
|
|
|
|
container('chart-testing') {
|
|
|
|
sh "chart_test.sh --no-install --all"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-09-29 18:54:21 +02:00
|
|
|
stage('Package') {
|
|
|
|
steps {
|
|
|
|
container('chart-testing'){
|
|
|
|
sh 'mkdir target'
|
|
|
|
sh 'for dir in charts/*; do helm package --destination target "$dir"; done'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Deploy') {
|
2018-09-29 19:38:49 +02:00
|
|
|
when {
|
|
|
|
branch 'master'
|
|
|
|
}
|
2018-09-29 18:54:21 +02:00
|
|
|
steps {
|
|
|
|
container('vault') {
|
|
|
|
script {
|
|
|
|
env.NEXUS_USER = sh(script: 'vault read -field=username secret/ops/account/nexus', returnStdout: true)
|
|
|
|
env.NEXUS_PWD = sh(script: 'vault read -field=password secret/ops/account/nexus', returnStdout: true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
container('alpine') {
|
|
|
|
sh 'set +x; for chart in target/*; do curl -L -u $NEXUS_USER:$NEXUS_PWD http://registry.molgenis.org/repository/helm/ --upload-file "$chart"; done'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-09-29 14:52:11 +02:00
|
|
|
}
|
|
|
|
}
|