mirror of
https://github.com/chillout2k/sos-milter.git
synced 2025-12-12 18:10:18 +00:00
Jenkins multibranch pipeline
This commit is contained in:
parent
0328bd1a6c
commit
2876c35ffa
@ -1,18 +1,15 @@
|
||||
def dockerImage = ''
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
dockerImage = ''
|
||||
imageName = 'sos-milter'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Build image') {
|
||||
steps {
|
||||
sh '/usr/bin/env'
|
||||
script {
|
||||
/* Multi-Branch Pipeline works with env.BRANCH_NAME*/
|
||||
dockerImage = docker.build("${env.imageName}:${env.BRANCH_NAME}","--pull --label BUILD_URL=${env.BUILD_URL} .")
|
||||
dockerImage = docker.build("sos-milter:${env.BRANCH_NAME}","--pull --label BUILD_URL=${env.BUILD_URL} .")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -29,12 +26,10 @@ pipeline {
|
||||
stage('Push image') {
|
||||
steps {
|
||||
script {
|
||||
docker.withRegistry('https://dockreg-fra.zwackl.de') {
|
||||
dockerImage.push()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Cleanup') {
|
||||
steps {
|
||||
sh 'echo "TODO: cleanup!"'
|
||||
@ -42,3 +37,4 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user