Give Pipeline the proper credentials to publish to Dockerhub
This commit is contained in:
parent
fe2d5a1f0d
commit
fbe1d22dd0
|
@ -2,9 +2,19 @@
|
||||||
|
|
||||||
|
|
||||||
node('docker') {
|
node('docker') {
|
||||||
|
checkout scm
|
||||||
|
|
||||||
stage 'Build Containers'
|
stage 'Build Containers'
|
||||||
sh './build-rubies.sh'
|
sh './build-rubies.sh'
|
||||||
|
|
||||||
stage 'Publish Containers'
|
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'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue