mirror of
https://github.com/chillout2k/sos-milter.git
synced 2025-12-15 19:29:45 +00:00
Jenkins Multi-Branch build
This commit is contained in:
parent
05382b2156
commit
0751c7ba4c
@ -3,6 +3,11 @@ pipeline {
|
|||||||
dockerImage = ''
|
dockerImage = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parameters {
|
||||||
|
string name: 'imageName', trim: false
|
||||||
|
string name: 'dockerRegistry', trim: false
|
||||||
|
}
|
||||||
|
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
@ -10,7 +15,8 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
sh '/usr/bin/env'
|
sh '/usr/bin/env'
|
||||||
script {
|
script {
|
||||||
dockerImage = docker.build("${env.imageName}:${env.GIT_LOCAL_BRANCH}","--pull --label \\\"GIT_COMMIT=${env.GIT_COMMIT}\\\" --label \\\"BUILD_URL=${env.BUILD_URL}\\\" .")
|
/* Multi-Branch Pipeline works with env.BRANCH_NAME*/
|
||||||
|
dockerImage = docker.build("${env.imageName}:${env.BRANCH_NAME}","--pull --label BUILD_URL=${env.BUILD_URL} .")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -18,7 +24,7 @@ pipeline {
|
|||||||
stage('Test image') {
|
stage('Test image') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
dockerImage.inside { c ->
|
dockerImage.inside {
|
||||||
sh '/usr/bin/env'
|
sh '/usr/bin/env'
|
||||||
sh '/bin/ps auxwwf'
|
sh '/bin/ps auxwwf'
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user