Jenkins with multiple projects and git branches

I would like to create one Jenkins job, that will build all my sub-projects A,B,C and D. For each of these sub-projects it should check the git repository if there are changes the */develop, */release/xx and */master branches. If there are changes in one of them, it should build (and run unit tests) for that branch and that subproject. I tried using the multi-config-pluging, which works pretty close to what I want. This works fine for nightly builds, but not for git-update-triggered builds. I can make this work using a shell script that will clone the desired repository and branch before running Ant.

Main problem is this: I cannot use the configuration parameters (like SUB_PROJECT=A, BRANCH=release/1.0) as SCM arguments. When I set the git respository url to "git@bitbucket.org:mine/$SUB_PROJECT.git" and the branch to "*/$BRANCH" it will not substitute the params with the values.

I don't like the "jenkins-autojobs" or "jenkins-build-per-branch" solutions, since I don't want to create 12+ jobs when one job could do it all.

Any ideas how to solve this?

Answers


This question is very similar to the following:

I recommended using Gerrit which can be integrated with Jenkins. Submitted patches are implemented as branches which are automatically verfied with a Jenkins job.

This may not be a complete solution, but would outsource the problem of managing short-lived feature branches.


Need Your Help

Liferay auto assign users to an organization on register

liferay organization

how to auto assign user to an organization when they register to a liferay portal.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.