views:

274

answers:

3

How can one setup continuous integration server to build multiple dependent projects?

I want to setup continuous integration process for a project hosted on a mercurial repository. The project however, has a compile time dependency on another project hosted in a different mercurial repository (both hosted on Google).

Using Hudson, how can I setup the CI job for both projects (while passing the binary locations of one to the other project build script)? Does other tools handle it better?

Both projects are Java projects with Ant build scripts.

A: 

In Cruise Control you have integration queues. You just put both projects on the same Queue in the order you want and they'll build one after the other.

Ryu
+2  A: 

I'd suggest looking into Maven (or if you don't want to move to Maven, Ivy, which integrates with Ant) - it's not really the CI server's job to handle artifact dependencies like you're talking about.

That said, if you have two jobs on a Hudson server, say, job_a and job_b, you can configure job_a to archive its artifacts (including the jar file(s) you need in job_b), and then kick off job_b when it finishes. And then, within job_b, you can then use ant's get task to download the jar file(s) from http://hudsonserver/job/job_a/lastStableBuild/artifact/jarfile.jar (etc). There'll always be something at that location, since it's a symlink to the last stable build of job_a, so you don't have to worry about job_b running and not finding the jarfile it needs.

abayer
+1  A: 

Hudson should be able to handle this as Hudson supports both dependent builds (in other words, a build can be kicked off by the completion of another build) and Mercurial.

According to this thread, it is possible to:

Configure Hudson to publish build artifacts and then HTTP get those artifacts to the dependent build. You want the location of your dependent build to be independent of the first build's location.

The author of the message gives a bit more details in Hudson Unleashed... that might help too.

Pascal Thivent