mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 07:15:49 +00:00
Update Jenkinsfile
This commit is contained in:
parent
eef13b4908
commit
c871decf3c
1 changed files with 3 additions and 4 deletions
7
Jenkinsfile
vendored
7
Jenkinsfile
vendored
|
@ -25,21 +25,20 @@ stages {
|
||||||
steps {
|
steps {
|
||||||
dir("spring-petclinic") {
|
dir("spring-petclinic") {
|
||||||
sh """
|
sh """
|
||||||
docker build -t pet-clinic:1.0 .
|
docker build -t nagarajub123/pet-clinic:${params.Docker_image_base_version}.${BUILD_NUMBER} .
|
||||||
docker ps -q --filter name=pet-clinic_container|grep -q . && (docker stop pet-clinic_container && docker rm pet-clinic_container) ||echo pet-clinic_container doesn\\'t exists
|
docker ps -q --filter name=pet-clinic_container|grep -q . && (docker stop pet-clinic_container && docker rm pet-clinic_container) ||echo pet-clinic_container doesn\\'t exists
|
||||||
docker run --name pet-clinic_container -d -p 8080:8080 pet-clinic:1.0
|
docker run --name pet-clinic_container -d -p 8080:8080 pet-clinic:1.0
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('publish') {
|
stage('publish to docker registry') {
|
||||||
steps {
|
steps {
|
||||||
withCredentials([usernamePassword(credentialsId: 'hub.docker',passwordVariable: 'docker_PSW', usernameVariable: 'docker_USR')]) {
|
withCredentials([usernamePassword(credentialsId: 'hub.docker',passwordVariable: 'docker_PSW', usernameVariable: 'docker_USR')]) {
|
||||||
sh """
|
sh """
|
||||||
docker login -u ${docker_USR} -p ${docker_PSW}
|
docker login -u ${docker_USR} -p ${docker_PSW}
|
||||||
docker images
|
docker images
|
||||||
docker tag pet-clinic:1.0 nagarajub123/pet-clinic:${params.Docker_image_base_version}.${BUILD_NUMBER}
|
docker push nagarajub123/pet-clinic:${params.Docker_image_base_version}.${BUILD_NUMBER}
|
||||||
docker push nagarajub123/pet-clinic:1.0
|
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue