mirror of
https://github.com/chillout2k/sos-milter.git
synced 2025-12-13 18:40:19 +00:00
49 lines
949 B
Plaintext
49 lines
949 B
Plaintext
pipeline {
|
|
environment {
|
|
dockerImage = ''
|
|
}
|
|
|
|
agent any
|
|
|
|
stages {
|
|
stage('Build image') {
|
|
steps {
|
|
sh '/usr/bin/env'
|
|
/* This builds the actual image; synonymous to
|
|
* docker build on the command line */
|
|
script {
|
|
dockerImage = docker.build("${env.imageName}:${env.GIT_LOCAL_BRANCH}")
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Test image') {
|
|
steps {
|
|
/* Ideally, we would run a test framework against our image.
|
|
* For this example, we're using a Volkswagen-type approach ;-) */
|
|
script {
|
|
dockerImage.inside {
|
|
sh 'echo "Tests passed"'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Push image') {
|
|
steps {
|
|
script {
|
|
docker.withRegistry(env.dockerRegistry) {
|
|
dockerImage.push()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Cleanup') {
|
|
steps {
|
|
sh 'echo "TODO: cleanup!"'
|
|
}
|
|
}
|
|
}
|
|
}
|