2018-05-03 10:11:30 +02:00
|
|
|
pipeline {
|
2018-05-03 11:02:59 +02:00
|
|
|
agent any
|
2018-05-03 10:11:30 +02:00
|
|
|
stages {
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2018-05-03 11:09:54 +02:00
|
|
|
sh 'docker build --pull -t workout:jenkins .'
|
2018-05-03 10:11:30 +02:00
|
|
|
}
|
|
|
|
}
|
2018-05-03 11:26:19 +02:00
|
|
|
stage('test') {
|
|
|
|
steps {
|
2018-05-03 11:29:05 +02:00
|
|
|
sh 'docker stop pg'
|
|
|
|
sh 'docker run --rm --name pg -d postgres'
|
2018-05-03 11:26:19 +02:00
|
|
|
sh 'docker image ls'
|
|
|
|
}
|
|
|
|
}
|
2018-05-03 10:11:30 +02:00
|
|
|
}
|
2018-05-03 11:29:05 +02:00
|
|
|
post {
|
|
|
|
always {
|
|
|
|
sh 'docker stop pg'
|
|
|
|
}
|
|
|
|
}
|
2018-05-03 11:02:34 +02:00
|
|
|
}
|