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 {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
environment {
|
|
||||||
dockerImage = ''
|
|
||||||
imageName = 'sos-milter'
|
|
||||||
}
|
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Build image') {
|
stage('Build image') {
|
||||||
steps {
|
steps {
|
||||||
sh '/usr/bin/env'
|
sh '/usr/bin/env'
|
||||||
script {
|
script {
|
||||||
/* Multi-Branch Pipeline works with env.BRANCH_NAME*/
|
/* 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,9 +26,7 @@ pipeline {
|
|||||||
stage('Push image') {
|
stage('Push image') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
docker.withRegistry('https://dockreg-fra.zwackl.de') {
|
dockerImage.push()
|
||||||
dockerImage.push()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,3 +37,4 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user