Tools:
Jenkins ver. 1.470
Maven 2
Subversion
Environment
Assume my build has a number of projects A-D. The dependency graph exists as shown. That is to say: B depends on classes in A, C depends on classes in B, D depends on classes in A. We create the jenkins builds such that they call the builds dependent upon them as a post-build action.
A
|--> B --> C
|--> D
Each night, we trigger a full build in Jenkins (A builds, triggers B (triggers C), triggers D). This is done easily enough by telling A to build nightly, and the rest cascades.
Problem
However, on a commit we want to build the projects that were committed to once.
Situation 1: We poll the repository (or use commit hooks, it makes no difference) and find that there was a commit to B, then B will build and C will build. Success!
Situation 2: We poll the repository and find that B and C were committed to in one commit, then Jenkins will try to build B (triggering a build of C), and build C (a second build). Failure. See what happens? C was built twice, taking up precious build time. Keep the build fast!
Does anyone know a way to only trigger the highest project in each committed build pipeline?
I suppose one solution would be a complex SVN hook that determines the highest project in each pipeline...
Pitfalls: Very complex SVN commit hook. Have to upkeep the pipeline in the SVN hook.
I feel like this is a problem others have run into. Is there a Jenkins plugin that helps with this?
It would be an idea to say jenkins to wait with the build until a build that c depends on is finished. The is an flag within the job configuration in order to do that. But you have to do this for each job. Btw ... there is also another flag that requires jenkins to wait with the build until a dependend job is finished.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With