mirror of
https://github.com/chillout2k/sos-milter.git
synced 2025-12-11 01:30:19 +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
|
||||
|
||||
parameters {
|
||||
string name: 'dockerRegistry', trim: true
|
||||
string defaultValue: 'https', name: 'dockerRegistryScheme', trim: true
|
||||
string defaultValue: 'change.me', name: 'dockerRegistryRepo', trim: true
|
||||
}
|
||||
|
||||
environment {
|
||||
@ -36,7 +37,7 @@ pipeline {
|
||||
stage('Push image') {
|
||||
steps {
|
||||
script {
|
||||
docker.withRegistry(env.dockerRegistry) {
|
||||
docker.withRegistry("${env.dockerRegistryScheme}://${env.dockerRegistryRepo}") {
|
||||
dockerImage.push()
|
||||
}
|
||||
}
|
||||
@ -45,6 +46,7 @@ pipeline {
|
||||
stage('Cleanup') {
|
||||
steps {
|
||||
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