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
7c47f9765f
commit
d780007d2c
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@ -2,7 +2,8 @@ pipeline {
|
|||||||
agent any
|
agent any
|
||||||
|
|
||||||
parameters {
|
parameters {
|
||||||
string name: 'dockerRegistry', trim: true
|
string defaultValue: 'https', name: 'dockerRegistryScheme', trim: true
|
||||||
|
string defaultValue: 'change.me', name: 'dockerRegistryRepo', trim: true
|
||||||
}
|
}
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
@ -36,7 +37,7 @@ pipeline {
|
|||||||
stage('Push image') {
|
stage('Push image') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
docker.withRegistry(env.dockerRegistry) {
|
docker.withRegistry("${env.dockerRegistryScheme}://${env.dockerRegistryRepo}") {
|
||||||
dockerImage.push()
|
dockerImage.push()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -45,6 +46,7 @@ pipeline {
|
|||||||
stage('Cleanup') {
|
stage('Cleanup') {
|
||||||
steps {
|
steps {
|
||||||
sh '/usr/bin/docker rmi -f "${imageName}:${BRANCH_NAME}"'
|
sh '/usr/bin/docker rmi -f "${imageName}:${BRANCH_NAME}"'
|
||||||
|
sh '/usr/bin/docker rmi -f "${dockerRegistryRepo}/${imageName}:${BRANCH_NAME}"'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user