Docker login stage

This commit is contained in:
JustFiesta 2024-04-30 11:08:05 +02:00
parent 559581b643
commit 69adb9c27a

12
Jenkinsfile vendored
View file

@ -35,6 +35,18 @@ pipeline {
sh 'docker build -t $NEXUS_DOCKER_REPO/spring-petclinic:${GIT_COMMIT} .'
}
}
stage('Docker Login') {
steps {
echo 'Nexus Docker Repository Login'
script{
withCredentials([usernamePassword(credentialsId: 'nexus-cred', usernameVariable: 'USER', passwordVariable: 'PASS' )]){
sh ' echo $PASS | docker login -u $USER --password-stdin $NEXUS_DOCKER_REPO'
}
}
}
}
}
post {