mirror of
https://github.com/chillout2k/sos-milter.git
synced 2025-12-15 19:29:45 +00:00
Jenkins declarative pipeline
This commit is contained in:
parent
2cc02c1ffe
commit
1c584584dc
@ -1,6 +1,6 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
environment{
|
environment {
|
||||||
dockerImage = ''
|
imageObject = ''
|
||||||
imageName = 'jenkins/sos-milter'
|
imageName = 'jenkins/sos-milter'
|
||||||
dockerRegistry = 'https://dockreg-fra.zwackl.de'
|
dockerRegistry = 'https://dockreg-fra.zwackl.de'
|
||||||
}
|
}
|
||||||
@ -19,7 +19,9 @@ pipeline {
|
|||||||
sh '/usr/bin/env'
|
sh '/usr/bin/env'
|
||||||
/* This builds the actual image; synonymous to
|
/* This builds the actual image; synonymous to
|
||||||
* docker build on the command line */
|
* docker build on the command line */
|
||||||
dockerImage = docker.build(imageName)
|
script {
|
||||||
|
imageObject = docker.build(imageName)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,18 +29,28 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
/* Ideally, we would run a test framework against our image.
|
/* Ideally, we would run a test framework against our image.
|
||||||
* For this example, we're using a Volkswagen-type approach ;-) */
|
* For this example, we're using a Volkswagen-type approach ;-) */
|
||||||
dockerImage.inside {
|
script {
|
||||||
sh 'echo "Tests passed"'
|
imageObject.inside {
|
||||||
|
sh 'echo "Tests passed"'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Push image') {
|
stage('Push image') {
|
||||||
steps {
|
steps {
|
||||||
docker.withRegistry(dockerRegistry) {
|
script {
|
||||||
dockerImage.push()
|
docker.withRegistry(dockerRegistry) {
|
||||||
|
imageObject.push()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('Cleanup') {
|
||||||
|
steps {
|
||||||
|
sh 'echo "TODO: cleanup!"'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user