简体   繁体   中英

Polling many SVN projects in one Jenkins CI job

I have a situation where a chain of Java projects in SVN need to be built for continuous integration. The projects can exist in multiple branches, and I want to perform CI builds on all of them. However, I would rather not have a different Jenkins project for each Java projects/SVN branch combination. What I have done is to create Jenkins projects that take the SVN branch as a parameter, and set up the project dependency chain, passing the branch parameter along. (I am using Ivy for this project, rather than Maven, so I don't have a plugin to do that for me.) I set up a chain kickoff job for each branch which defines the branch parameter and starts automatically several times each day.

PROS: This allows me to create a single Jenkins kick-off project for each branch, rather than the entire chain of projects.

CONS: The build happens on a schedule, rather than as a result of SVN polling. This means all the branches build multiple times a day, even if no changes have been made in that branch.

What I would like to happen ideally is have the kickoff project poll ALL the projects in the chain periodically, and build the chain if there are any changes. Is there a way to do that? Would it be as simple as specifying all the project locations in the kickoff project (using the branch parameter) and then specify polling as the build trigger?

If I understand correctly: you want to poll a number of SVN locations from your "kickoff" job, but you don't want your "kickoff" job to actually checkout all those SVN locations?

You can configure the "kickoff" job, give it all possible SVN locations (or a top-level location, such as /branches/ that will have all branches under it), and set the checkout depth to empty . Then configure SCM polling on this job. It will poll all SVN locations, but won't actually perform the lengthy checkout. Once SCM changes are detected, your kickoff job will start, and trigger the rest of your chain

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