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