mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 07:45:49 +00:00
Update Jenkinsfile
This commit is contained in:
parent
3750a7d571
commit
64e98ac289
1 changed files with 9 additions and 7 deletions
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
|
@ -46,9 +46,7 @@ pipeline {
|
|||
stage('Tag the docker image') {
|
||||
when {
|
||||
// Condition to execute the stage when the branch is main
|
||||
expression {
|
||||
return (env.CHANGE_ID == null && env.BRANCH_NAME != 'main')
|
||||
}
|
||||
changeRequest()
|
||||
}
|
||||
steps {
|
||||
echo "now we will tag the docker image"
|
||||
|
@ -99,8 +97,10 @@ pipeline {
|
|||
}
|
||||
stage('Tag docker image again for the main repo') {
|
||||
when {
|
||||
// Condition to execute the stage when the branch is main
|
||||
changeRequest()
|
||||
// Condition to execute the stage when the branch is 'main'
|
||||
expression {
|
||||
return env.BRANCH_NAME == 'main'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
echo "now we will tag the docker image for the main branch"
|
||||
|
@ -116,8 +116,10 @@ pipeline {
|
|||
}
|
||||
stage('Push docker image to main repository') {
|
||||
when {
|
||||
// Condition to execute the stage when the branch is main
|
||||
changeRequest()
|
||||
// Condition to execute the stage when the branch is 'main'
|
||||
expression {
|
||||
return env.BRANCH_NAME == 'main'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
echo "now we will push the image to the docker main repository"
|
||||
|
|
Loading…
Reference in a new issue