Give Pipeline the proper credentials to publish to Dockerhub

This commit is contained in:
R. Tyler Croy 2016-08-03 12:26:46 -07:00
parent fe2d5a1f0d
commit fbe1d22dd0
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 11 additions and 1 deletions

12
Jenkinsfile vendored
View File

@ -2,9 +2,19 @@
node('docker') {
checkout scm
stage 'Build Containers'
sh './build-rubies.sh'
stage 'Publish Containers'
sh './push-rubies.sh'
/* Using credentials with the ID 'dockerhub' from the Jenkins installation */
withCredentials([[$class: 'UsernamePasswordMultiBinding',
credentialsId: 'dockerhub',
passwordVariable: 'DOCKERHUB_TOKEN',
usernameVariable: 'DOCKERHUB_EMAIL']]) {
/* Our variables be exposed in the environment and we must log in before trying to publish to Dockerhub */
sh 'docker login --username ${DOCKERHUB_EMAIL} --password ${DOCKERHUB_TOKEN}'
sh './push-rubies.sh'
}
}