Update Jenkinsfile

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

8
Jenkinsfile vendored
View file

@ -47,7 +47,7 @@ pipeline {
when {
// Condition to execute the stage when the branch is main
expression {
return (env.CHANGE_ID == null && env.BRANCH_NAME == 'main')
return (env.CHANGE_ID == null && env.BRANCH_NAME != 'main')
}
}
steps {
@ -78,9 +78,7 @@ pipeline {
stage('Push to DockerHub') {
when {
// Condition to execute the stage when the branch is main
expression {
return (env.CHANGE_ID == null && env.BRANCH_NAME == 'main')
}
changeRequest()
}
steps {
echo "now we will push to the docker file"
@ -122,7 +120,7 @@ pipeline {
when {
// Condition to execute the stage on a pull request event
expression {
return env.CHANGE_ID != null
return (env.CHANGE_ID == null && env.BRANCH_NAME == 'main')
}
}
steps {