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') {
|
stage('Tag the docker image') {
|
||||||
when {
|
when {
|
||||||
// Condition to execute the stage when the branch is main
|
// Condition to execute the stage when the branch is main
|
||||||
expression {
|
changeRequest()
|
||||||
return (env.CHANGE_ID == null && env.BRANCH_NAME != 'main')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
echo "now we will tag the docker image"
|
echo "now we will tag the docker image"
|
||||||
|
@ -99,9 +97,11 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('Tag docker image again for the main repo') {
|
stage('Tag docker image again for the main repo') {
|
||||||
when {
|
when {
|
||||||
// Condition to execute the stage when the branch is main
|
// Condition to execute the stage when the branch is 'main'
|
||||||
changeRequest()
|
expression {
|
||||||
|
return env.BRANCH_NAME == 'main'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
echo "now we will tag the docker image for the main branch"
|
echo "now we will tag the docker image for the main branch"
|
||||||
script {
|
script {
|
||||||
|
@ -116,9 +116,11 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('Push docker image to main repository') {
|
stage('Push docker image to main repository') {
|
||||||
when {
|
when {
|
||||||
// Condition to execute the stage when the branch is main
|
// Condition to execute the stage when the branch is 'main'
|
||||||
changeRequest()
|
expression {
|
||||||
|
return env.BRANCH_NAME == 'main'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
echo "now we will push the image to the docker main repository"
|
echo "now we will push the image to the docker main repository"
|
||||||
script {
|
script {
|
||||||
|
|
Loading…
Reference in a new issue