fix jenkins conditional stages using GIT_BRANCH environment variable

This commit is contained in:
RebeccaNod1 2025-08-12 06:46:24 -05:00
parent c7bb6dae6d
commit b85cd4cba0

20
Jenkinsfile vendored
View file

@ -48,10 +48,10 @@ pipeline {
stage('Preprocess Scripts') {
when {
anyOf {
branch 'main'
branch 'origin/main'
branch 'develop'
branch 'origin/develop'
environment name: 'GIT_BRANCH', value: 'origin/main'
environment name: 'GIT_BRANCH', value: 'origin/develop'
environment name: 'GIT_BRANCH', value: 'main'
environment name: 'GIT_BRANCH', value: 'develop'
}
}
steps {
@ -70,8 +70,8 @@ pipeline {
stage('Generate Release Package') {
when {
anyOf {
branch 'main'
branch 'origin/main'
environment name: 'GIT_BRANCH', value: 'origin/main'
environment name: 'GIT_BRANCH', value: 'main'
}
}
steps {
@ -115,8 +115,8 @@ pipeline {
stage('Update Documentation') {
when {
anyOf {
branch 'main'
branch 'origin/main'
environment name: 'GIT_BRANCH', value: 'origin/main'
environment name: 'GIT_BRANCH', value: 'main'
}
}
steps {
@ -143,8 +143,8 @@ pipeline {
stage('Notify Success') {
when {
anyOf {
branch 'main'
branch 'origin/main'
environment name: 'GIT_BRANCH', value: 'origin/main'
environment name: 'GIT_BRANCH', value: 'main'
}
}
steps {