mirror of
https://github.com/chillout2k/sos-milter.git
synced 2025-12-12 18:10:18 +00:00
Jenkins scripted multibranch pipeline
This commit is contained in:
parent
db1c408c58
commit
b6c9425005
@ -1,20 +1,19 @@
|
|||||||
node {
|
node {
|
||||||
def dockerImage
|
def app
|
||||||
|
|
||||||
stage('Clone repository') {
|
stage('Clone repository') {
|
||||||
sh '/usr/bin/env'
|
sh '/usr/bin/env'
|
||||||
/* Let's make sure we have the repository cloned to our workspace */
|
|
||||||
checkout scm
|
checkout scm
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build image') {
|
stage('Build image') {
|
||||||
sh '/usr/bin/env'
|
sh '/usr/bin/env'
|
||||||
/* Multi-Branch Pipeline works with env.BRANCH_NAME*/
|
/* Multi-Branch Pipeline works with env.BRANCH_NAME*/
|
||||||
dockerImage = docker.build("sos-milter:${env.BRANCH_NAME}","--pull --label BUILD_URL=${env.BUILD_URL} .")
|
app = docker.build("sos-milter:${env.BRANCH_NAME}","--pull --label BUILD_URL=${env.BUILD_URL} .")
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Test image') {
|
stage('Test image') {
|
||||||
dockerImage.inside {
|
app.inside {
|
||||||
sh '/usr/bin/env'
|
sh '/usr/bin/env'
|
||||||
sh '/bin/ps auxwwf'
|
sh '/bin/ps auxwwf'
|
||||||
}
|
}
|
||||||
@ -22,7 +21,7 @@ node {
|
|||||||
|
|
||||||
stage('Push image') {
|
stage('Push image') {
|
||||||
docker.withRegistry('https://dockreg-fra.zwackl.de') {
|
docker.withRegistry('https://dockreg-fra.zwackl.de') {
|
||||||
dockerImage.push()
|
app.push()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user