David Bremmen
David Bremmen

Reputation: 75

How to implement continuous delivery when there are dependencies between projects in Jenkins

I've been scratching my head a long time trying to figure out a solution to this problem but haven't come up with good solution yet, maybe somebody can help me with any suggestion or good practice.

Here it goes:

I have three git projects: compilerweb, compiler and common

What I'd like to do is to configure a continuous integration schema where any commit and push on any of the three projects launch a full build to ensure the stability of the whole project but I'm not sure what procedure or strategy to put in place

What I tried first was the following:

But with this schema for example if a developer is working on the three projects at the same time, and then he executes a commit and push on the compilerweb project then a full build will be launched without his changes in common and compiler and the build will fail.

What is the standard way of implementing continuous integration when there are dependencies between the projects and all of them are pointing to master branch?

Thanks a lot for any suggestion or answer! :)

Upvotes: 0

Views: 103

Answers (1)

Joao  Vitorino
Joao Vitorino

Reputation: 3256

Configure one job to start another.

When common finish to build with success, start compiler.

When compiler finish with success, start compilerweb

You configure this in "Post build Action" >> "Build another projects"

Configure to trigger compiler job on push to any git repository.

This way, no matter where the push happens, every time you will run the 3 jobs.

You can add a delay to the jobs to avoid problems with commit and push on all the git repos.

Trigger job with delay

http://myjenkins/job/jobname/build?delay=15

Another approach is just run the build if the commit has or not a specific message. For this to work you will need talk with the developers. If they are going to make a change that needs commit on 3 repos, start the build only on the last commit.

For example:

Configure the script to not start the build if the commit has the the word's "ON HOLD" in message.

Upvotes: 2

Related Questions