mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 23:05:50 +00:00
deploy only when branch is master
This commit is contained in:
parent
152664bd2c
commit
832dcf31fd
1 changed files with 7 additions and 1 deletions
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
|
@ -30,6 +30,9 @@ stages {
|
|||
}
|
||||
stage("deploy") {
|
||||
steps {
|
||||
when {
|
||||
branch 'master'
|
||||
}
|
||||
dir("spring-petclinic") {
|
||||
sh """
|
||||
docker build -t nagarajub123/pet-clinic:${params.Docker_image_base_version}.${BUILD_NUMBER} .
|
||||
|
@ -40,7 +43,10 @@ stages {
|
|||
}
|
||||
}
|
||||
stage('publish to docker registry') {
|
||||
steps {
|
||||
when {
|
||||
branch 'master'
|
||||
}
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'hub.docker',passwordVariable: 'docker_PSW', usernameVariable: 'docker_USR')]) {
|
||||
sh """
|
||||
docker login -u ${docker_USR} -p ${docker_PSW}
|
||||
|
|
Loading…
Reference in a new issue