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