mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 15:25:49 +00:00
Docker login stage
This commit is contained in:
parent
559581b643
commit
69adb9c27a
1 changed files with 14 additions and 2 deletions
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
|
@ -31,9 +31,21 @@ pipeline {
|
||||||
stage('Docker Build') {
|
stage('Docker Build') {
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
echo 'Building docker Image'
|
echo 'Building docker Image'
|
||||||
sh 'docker build -t $NEXUS_DOCKER_REPO/spring-petclinic:${GIT_COMMIT} .'
|
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'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue