Jenkinsfile and different strategies for branches

前端 未结 7 1804
星月不相逢
星月不相逢 2021-01-31 03:23

I\'m trying to use Jenkins file for all our builds in Jenkins, and I have following problem. We basically have 3 kind of builds:

  • pull-request build - it will be me
7条回答
  •  忘了有多久
    2021-01-31 03:34

    1) I don't know if it is appropriate, but if it resolves your problem, I think is appropriate enough.

    2) In order to know the name of the branch you can use BRANCH_NAME variable, its name is taken from the branch name.

    ${env.BRANCH_NAME}
    

    Here is the answer: Jenkins Multibranch pipeline: What is the branch name variable?

提交回复
热议问题