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') {
|
stage('Tag docker image again for the main repo') {
|
||||||
when {
|
when {
|
||||||
// Condition to execute the stage on a pull request event
|
// Condition to execute the stage when the branch is main
|
||||||
expression {
|
changeRequest()
|
||||||
return env.CHANGE_ID != null
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
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 {
|
||||||
|
@ -118,11 +116,9 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('Push docker image to main repository') {
|
stage('Push docker image to main repository') {
|
||||||
when {
|
when {
|
||||||
// Condition to execute the stage on a pull request event
|
// 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 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