Jenkins scripted multibranch pipeline

This commit is contained in:
Dominik Chilla 2019-06-14 21:36:33 +02:00
parent b6c9425005
commit 01a109b585
2 changed files with 32 additions and 2 deletions

1
Jenkinsfile vendored
View File

@ -1 +0,0 @@
Jenkinsfile.scripted.multibranch

31
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,31 @@
node {
def app
stage('Clone repository') {
sh '/usr/bin/env'
checkout scm
}
stage('Build image') {
sh '/usr/bin/env'
/* Multi-Branch Pipeline works with env.BRANCH_NAME*/
app = docker.build("sos-milter:${env.BRANCH_NAME}","--pull --label BUILD_URL=${env.BUILD_URL} .")
}
stage('Test image') {
app.inside {
sh '/usr/bin/env'
sh '/bin/ps auxwwf'
}
}
stage('Push image') {
docker.withRegistry('https://dockreg-fra.zwackl.de') {
app.push()
}
}
stage('Cleanup') {
sh 'echo "TODO: cleanup!"'
}
}

View File

@ -5,7 +5,7 @@ node {
sh '/usr/bin/env'
checkout scm
}
stage('Build image') {
sh '/usr/bin/env'
/* Multi-Branch Pipeline works with env.BRANCH_NAME*/