fix jenkins conditional stages using GIT_BRANCH environment variable
This commit is contained in:
parent
c7bb6dae6d
commit
b85cd4cba0
1 changed files with 10 additions and 10 deletions
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue