pipeline script and git parameter plugin

113 views
Skip to first unread message

suoyua...@shopee.com

unread,
Aug 9, 2018, 11:55:55 AM8/9/18
to Jenkins Users
Hi, I am running jenkins2 and pipeline for my job

My pipeline definition is pipeline script(not pipeline script from SCM) and I am using git as my scm system.

I want to specify a git branch before a build starts. How can I do this?

Mark Waite

unread,
Aug 9, 2018, 7:45:56 PM8/9/18
to Jenkins Users
If you know the list of branch names that you want to present in the list, you can use the Jenkins Minute video https://www.youtube.com/watch?v=5_tvlaIeQUQ as an example to parameterize the PIpeline job.

If you want the list of branches to be generated dynamically based on the contents of the repository, investigate the git parameter plugin at https://plugins.jenkins.io/git-parameter

Mark Waite

suoyua...@shopee.com

unread,
Aug 23, 2018, 3:51:41 AM8/23/18
to Jenkins Users
After digging into the git parameter plugin, I find it is hard to get what I want since the plugin uses SCM which I do not want it configure in the job.

I am now developing my own plugin that meets my demand, see list-git-branches-plugin

Thank you for replying!!
Reply all
Reply to author
Forward
0 new messages