Get git branch name in Jenkins Pipeline/Jenkinsfile

前端 未结 7 1325
借酒劲吻你
借酒劲吻你 2020-12-13 08:06

I\'ve create a jenkins pipeline and it is pulling the pipeline script from scm.
I set the branch specifier to \'all\', so it builds on any change to any bra

相关标签:
7条回答
  • 2020-12-13 09:07

    For pipeline:

    pipeline {
      environment {
         BRANCH_NAME = "${GIT_BRANCH.split("/")[1]}"
      }
    }
    
    0 讨论(0)
提交回复
热议问题