Skip to content

Commit

Permalink
jenkinsfile fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
  • Loading branch information
berezovskyi committed Feb 16, 2022
1 parent 4240f82 commit 1cdd74f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ pipeline {
maven 'apache-maven-latest'
jdk 'temurin-jdk11-latest'
}
pipeline {
environment {
// https://stackoverflow.com/questions/42383273/get-git-branch-name-in-jenkins-pipeline-jenkinsfile
BRANCH_NAME_B = "${GIT_BRANCH.split("/")[1]}"
BRANCH_NAME_A = "${GIT_BRANCH.split("/").size() > 1 ? GIT_BRANCH.split("/")[1] : GIT_BRANCH}"
BRANCH_NAME = "${GIT_BRANCH.split('/').size() > 1 ? GIT_BRANCH.split('/')[1..-1].join('/') : GIT_BRANCH}"
}
environment {
// https://stackoverflow.com/questions/42383273/get-git-branch-name-in-jenkins-pipeline-jenkinsfile
BRANCH_NAME_B = "${GIT_BRANCH.split("/")[1]}"
BRANCH_NAME_A = "${GIT_BRANCH.split("/").size() > 1 ? GIT_BRANCH.split("/")[1] : GIT_BRANCH}"
BRANCH_NAME = "${GIT_BRANCH.split('/').size() > 1 ? GIT_BRANCH.split('/')[1..-1].join('/') : GIT_BRANCH}"
}
stages {
stage('Debug') {
Expand Down

0 comments on commit 1cdd74f

Please sign in to comment.