1

How do I configure Jenkins to build all branches while giving the master branch the highest priority?

My first idea was to create two jobs with one configured to build all branches and the other to just build master, then using the job priority plugin to configure master ahead.

This doesn't work since all branches obviously builds all branches including master.

maletor
  • 7,072
  • 7
  • 42
  • 63

2 Answers2

1

Git plugin has the BuildChooser extension point for this kind of purposes. Git plugin tells you all the interesting revisions that you might want to build (new tip commits that haven't been built before), and BuildChooser gets to decide which revision gets built.

So if your BuildChooser always prefer to build the mater, you get the desired semantics.

Kohsuke Kawaguchi
  • 3,567
  • 3
  • 19
  • 21
  • Did some quick research on BuildChooser. I have the git plugin installed for Jenkins, but I'm not sure how to do what I described since I can't find any documentation on BuildChooser. – maletor Sep 23 '11 at 23:00
  • @Maletor: You need to write a Jenkins plugin with a "`EverythingButMasterBuildChooser`" class which extends `BuildChooser` (see the default implemenation for reference http://is.gd/hiWvtQ). – Christopher Orr Sep 24 '11 at 11:21
0

Christopher solved my question by writing the functionality.

Give this guy some karma.

Community
  • 1
  • 1
maletor
  • 7,072
  • 7
  • 42
  • 63