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
2ee009a61c
commit
eef13b4908
1 changed files with 17 additions and 1 deletions
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
|
@ -1,4 +1,4 @@
|
|||
def targetMail = "bnagaraju96756@gmail.com,jenkinsautomationuser@gmail.com"
|
||||
def targetMail = "jenkinsautomationuser@gmail.com"
|
||||
def emailDevOps(targetMail, msg) {
|
||||
emailext body: "${msg}\nplease look into the build: ${BUILD_URL}", subject: "${currentBuild.result}: ${BUILD_TAG}", to: "${targetMail}"
|
||||
}
|
||||
|
@ -7,6 +7,10 @@ pipeline {
|
|||
options {
|
||||
timestamps()
|
||||
}
|
||||
parameters {
|
||||
string(name: 'Docker_image_base_version',defaultValue: '1',description:"docker base image version for pet-clinic application.\nex: 1,2,3 as in 1.0,2.1,3.5")
|
||||
}
|
||||
|
||||
stages {
|
||||
stage("build") {
|
||||
steps {
|
||||
|
@ -28,6 +32,18 @@ stages {
|
|||
}
|
||||
}
|
||||
}
|
||||
stage('publish') {
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'hub.docker',passwordVariable: 'docker_PSW', usernameVariable: 'docker_USR')]) {
|
||||
sh """
|
||||
docker login -u ${docker_USR} -p ${docker_PSW}
|
||||
docker images
|
||||
docker tag pet-clinic:1.0 nagarajub123/pet-clinic:${params.Docker_image_base_version}.${BUILD_NUMBER}
|
||||
docker push nagarajub123/pet-clinic:1.0
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always{
|
||||
|
|
Loading…
Reference in a new issue