Skip to content

Commit

Permalink
Merge pull request #43 from docker/test-compose
Browse files Browse the repository at this point in the history
added steps to test composing environment before pushing to dockerhub
  • Loading branch information
chubing authored May 18, 2018
2 parents 9ac51b3 + 13c7a1b commit 9dcad39
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pipeline {
}
}
}
stage('Build') {
stage('Clean') {
steps {
script {
try{
Expand All @@ -45,11 +45,15 @@ pipeline {
}
}
}
stage('Push') {
stage('Build') {
steps {
script {
docker.withRegistry('https://registry.hub.docker.com/', "dockerhub-$maintainer") {
def baseImg = docker.build("$maintainer/$imagename", "--no-cache .")
// test the environment
sh 'cd test-compose && ./compose.sh'
// bring down after testing
sh 'cd test-compose && docker-compose down'
baseImg.push("$tag")
}
}
Expand Down

0 comments on commit 9dcad39

Please sign in to comment.