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
4411f8c369
commit
3750a7d571
1 changed files with 5 additions and 9 deletions
14
Jenkinsfile
vendored
14
Jenkinsfile
vendored
|
@ -99,11 +99,9 @@ pipeline {
|
|||
}
|
||||
stage('Tag docker image again for the main repo') {
|
||||
when {
|
||||
// Condition to execute the stage on a pull request event
|
||||
expression {
|
||||
return env.CHANGE_ID != null
|
||||
// Condition to execute the stage when the branch is main
|
||||
changeRequest()
|
||||
}
|
||||
}
|
||||
steps {
|
||||
echo "now we will tag the docker image for the main branch"
|
||||
script {
|
||||
|
@ -118,11 +116,9 @@ pipeline {
|
|||
}
|
||||
stage('Push docker image to main repository') {
|
||||
when {
|
||||
// Condition to execute the stage on a pull request event
|
||||
expression {
|
||||
return (env.CHANGE_ID == null && env.BRANCH_NAME == 'main')
|
||||
}
|
||||
}
|
||||
// Condition to execute the stage when the branch is main
|
||||
changeRequest()
|
||||
}
|
||||
steps {
|
||||
echo "now we will push the image to the docker main repository"
|
||||
script {
|
||||
|
|
Loading…
Reference in a new issue