Update Jenkinsfile

This commit is contained in:
Mihai Georgescu 2023-11-29 15:24:21 +02:00 committed by GitHub
parent 4411f8c369
commit 3750a7d571
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

12
Jenkinsfile vendored
View file

@ -99,10 +99,8 @@ 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"
@ -118,10 +116,8 @@ 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"