Skip to content

Commit

Permalink
build docker in jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
Aren Chen committed Jun 20, 2018
1 parent b887c30 commit 18ceadb
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,33 @@ pipeline {
}
}
}
stage("Build Image"){
steps {
script {
dir ("src/github.com/linkernetworks/vortex") {
docker.build("sdnvortex/vortex" , "--file ./dockerfiles/Dockerfile .")
}
}
}
}
stage("Push Image"){
when {
branch 'master'
}
steps {
script {
withCredentials([
usernamePassword(
credentialsId: 'eb1d8dd2-afd2-49d3-bbef-605de4f664d2',
usernameVariable: 'DOCKER_USER',
passwordVariable: 'DOCKER_PASS'
)
]) {
sh 'echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin'
}
docker.image("sdnvortex/vortex").push("master")
}
}
}
}
}

0 comments on commit 18ceadb

Please sign in to comment.