diff --git a/Jenkinsfile b/Jenkinsfile index 83fa391..e2a1a57 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,16 +32,19 @@ node { * First, the incremental build number from Jenkins * Second, the 'latest' tag. * Pushing multiple tags is cheap, as all the layers are reused. */ - def docker_tag - script { - if (env.BRANCH_NAME == 'master') { - app.push() - } else { - app.push("devel") - } + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'docker-hub-credentials', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { + sh 'docker login -u $USERNAME -p $PASSWORD' + script { + if (env.BRANCH_NAME == 'master') { + app.push() + } else { + app.push("devel") + } + } } + } stage('Cleaning'){ sh "docker image prune -f"