mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 15:55:49 +00:00
Update Jenkinsfile
This commit is contained in:
parent
74b324f96d
commit
4411f8c369
1 changed files with 4 additions and 6 deletions
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
|
@ -47,7 +47,7 @@ pipeline {
|
||||||
when {
|
when {
|
||||||
// Condition to execute the stage when the branch is main
|
// Condition to execute the stage when the branch is main
|
||||||
expression {
|
expression {
|
||||||
return (env.CHANGE_ID == null && env.BRANCH_NAME == 'main')
|
return (env.CHANGE_ID == null && env.BRANCH_NAME != 'main')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
|
@ -78,9 +78,7 @@ pipeline {
|
||||||
stage('Push to DockerHub') {
|
stage('Push to DockerHub') {
|
||||||
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 push to the docker file"
|
echo "now we will push to the docker file"
|
||||||
|
@ -122,8 +120,8 @@ pipeline {
|
||||||
when {
|
when {
|
||||||
// Condition to execute the stage on a pull request event
|
// Condition to execute the stage on a pull request event
|
||||||
expression {
|
expression {
|
||||||
return env.CHANGE_ID != null
|
return (env.CHANGE_ID == null && 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"
|
||||||
|
|
Loading…
Reference in a new issue