简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM