Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring Hudson/Jenkins to build all mercurial branches

How do I configure Hudson/Jenkins (we're still using Hudson) to build all branches with the mercurial plugin? I have seen that we can create separate jobs/etc for specific branches, but we branch often enough that it would be good to just build all branches.

The only way I can think of (and I haven't tried it) is to have our build script [executed by Hudson on the slave] somehow figure out which branch is the latest commit and then hg update -r itself, rather than the mercurial plugin doing it.

I would love to find out a more elegant/correct way to do this!

like image 738
FliesLikeABrick Avatar asked Aug 10 '12 03:08

FliesLikeABrick


2 Answers

I've also been looking for this support in the Jenkins Mercurial plugin (partly because it's supported by its Git plugin) but the following Jenkins tickets seem to indicate that this is yet not implemented:

  • https://issues.jenkins-ci.org/browse/JENKINS-11102
  • https://issues.jenkins-ci.org/browse/JENKINS-10558
like image 118
mikewse Avatar answered Oct 22 '22 01:10

mikewse


One option if you have branches that are used regularly (ie, named branches for milestones or developers) is to create copies of your master build and simply point it to that branch.

For example on my team's build server we have production ('default' branch) and development ('dev' branch). Our builds are run by feeding the branch name as a parameter to the build script (so it's a simple, one-field change from a copy of the main job).

Obviously this won't scale beyond a handful of branches, but it might be enough for your needs.

like image 35
Peter Bernier Avatar answered Oct 22 '22 00:10

Peter Bernier