I've been dealing with the problem of scaling CI at my company and at the same time trying to figure out which approach to take when it comes to CI and multiple branches. There is a similar question at stackoverflow, Multiple feature branches and continuous integration. I've started a new one because I'd like to get more of discussion and provide some analysis in the question.
So far I've found that there are 2 main approaches that I can take (or maybe some others???).
- Multiple set of jobs (talking about Jenkins/Hudson here) per branch
- Write tooling to manage the extra jobs
- Create/modify/delete Jobs in bulk
- Custom settings for each job per branch (SCM url, dep management repos duplications)
- Some examples of people tackling this problem with shell tools, ant scripts and Jenkins CLI. See:
- http://jenkins.361315.n4.nabble.com/Multiple-branches-best-practice-td2306578.html
- http://jenkins.361315.n4.nabble.com/Is-it-possible-to-handle-multiple-branches-where-some-jobs-should-run-on-each-one-without-duplicatin-td954729.html
- http://jenkins.361315.n4.nabble.com/Parallel-development-with-branches-td1013013.html
- Configure or Create hudson job automatically
- Will cause more load on your CI cluster
- Feedback cycle for devs slows down (if the infrastructure cannot handle the new load)
- Write tooling to manage the extra jobs
- Multiple set of jobs per 2 branches (dev & stable)
- Manage the two sets manually (if you change the conf of a job then be sure to change in the other branch)
- PITA but at least so few to manage
- Other extra branches won't get a full test suite before they get pushed to dev
- Unsatisfied devs. Why should a dev care about CI scaling problems. He has a simple request, when I branch I would like to test my code. Simple.
- Manage the two sets manually (if you change the conf of a job then be sure to change in the other branch)
So it seems if I want to provide devs with CI for their own custom branches I need special tooling for Jenkins (API or shellscripts or something?) and handle scaling. Or I can tell them to merge more often to DEV and live without CI on custom branches. Which one would you take or are there other options?