Handing off builds between Jenkins masters

15 views
Skip to first unread message

Jim McCaskey

unread,
Mar 2, 2012, 10:52:22 AM3/2/12
to jenkins...@googlegroups.com
Hello all,

I've looked around for a bit for something to do what I want, and before I spend a whole lot of time hacking around, I thought I would ask. I would like to be able to have one Jenkins master start a build on another Jenkins master. Just like the existing "Build other projects" functionality, but instead of calling the other project on the local Jenkins Master, call it on a remote Jenkins master.

Why do I want to do this? Our Jenkins use is growing internally (a good thing!) and other groups want to use the system for their own automation purposes. These other groups are doing more detailed testing, integration work, and some system maintenance and the existing Jenkins administrators don't want to deal with that. There's also the issue of passwords/security to deal with between the completely separate groups. It seems like if there was a way to spawn projects off on another Jenkins master than the other groups could have their own masters and work them as they see fit.

I've thought of a few ways to handle this (the Jenkins CLI immediately comes to mind), but wanted to know if there was a cleaner implementation that could make this happen.

Thanks!

-Jim

Neerenberg, Aaron

unread,
Mar 2, 2012, 11:21:43 AM3/2/12
to jenkins...@googlegroups.com
Jim-

I remember there being a plugin, a while back, which would allow one Jenkins instance to invoke jobs directly upon another; however, it required that the job be defined on both servers with the same name. I currently run several Jenkins instances (different dev centers), and, for the most part, ended up just using a group of wget calls to call the correct URL's for the API of the target instance.

Regards,
Aaron

Jim McCaskey

unread,
Mar 2, 2012, 11:52:22 AM3/2/12
to jenkins...@googlegroups.com
Aaron,

Thanks for the feedback. I was afraid it would boil down to something like that. I was hoping for a solution which a novice could use pretty easily. One of the great things of administering Jenkins is that it's pretty easy to set up and get going. I looked for a plugin you suggested but couldn't find it. Even if it was too restrictive I could try and find some time to augment it to do what I want. I suppose I could always start from scratch. :)

-Jim

Didier Durand

unread,
Mar 2, 2012, 12:02:16 PM3/2/12
to Jenkins Users
Hi,

I think this plugin can help https://wiki.jenkins-ci.org/display/JENKINS/Job+Import+Plugin
to list what's available on the other instance to be launched

I can also provide some Java code to do remote job launching with
authentication when needed. Just let me know

By combining the 2, you should be close to achieve what you want

regards

didier

domi

unread,
Mar 3, 2012, 2:33:00 AM3/3/12
to jenkins...@googlegroups.com
We do this with wget in a shell step

$> wget http://someserver.com/job/jobA/build?delay=0sec

…just the same way as if you would trigger it from a command line.
If you use the conditional-buildstep-plugin you can wrap the execution into conditions too.
/Domi

danny staple

unread,
Mar 3, 2012, 4:50:43 AM3/3/12
to jenkins...@googlegroups.com
We've used the wget/curl methods quite successfully for this. It's worth getting to know as it also allows builds to start other builds in ways the plugins dont usually cover - although we are taking note of the ssh API.
--
Danny Staple

Director, ODM Solutions Ltd
w: http://www.odmsolutions.co.uk
Blog: http://orionrobots.co.uk/blog1-Danny-Staple


Sami Tikka

unread,
Mar 3, 2012, 12:20:39 PM3/3/12
to jenkins...@googlegroups.com
I have recently used the ssh API because it allows one to trigger a build and wait for its completion, which was useful for one seldom-used task.

-- Sami

Jacob Robertson

unread,
Mar 5, 2012, 11:31:44 AM3/5/12
to jenkins...@googlegroups.com
We are wanting a similar thing. We want a successful build to kick of
a particular parameterized build on another master. Right now, we've
prototyped using wget (using "buildWithParameters") from within the
flexible publish plugin so that it can be a post-build action. It
seems to work fine, but it really feels like a cludge. If anyone does
end up writing some plugin code for this, I would be happy to test it.
Reply all
Reply to author
Forward
0 new messages