how to pass project parameter as branch name to build in Jenkins

拜拜、爱过 提交于 2019-12-07 13:27:02

问题


I am wondering is there any way we can pass the value of project parameter as the Git branch to build from.

Below is what I am trying to do:

  1. Create a Jenkins pipeline project with a build parameter:

  1. Then I tried to using the project parameter to pass it on (Branches to build)

However the branch_name variable is not resolved from the project parameter.

I could do manually change branch name for every build, but it is far from ideal.

Appreciate for any idea?


回答1:


This issue has been reported several times. This works if you disable the "Lightweight Checkout". Apparently the code path is very different if you are using the lightweight checkout, and that has not been resolved, apparently.

See JENKINS-28447



来源:https://stackoverflow.com/questions/46701461/how-to-pass-project-parameter-as-branch-name-to-build-in-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!