Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a master jenkins run jobs on remote jenkins?

We are migrating from CruiseControl.NET to Jenkins just to be in sync with a partner so we don't have two different CI scripts. We are trying to setup Jenkins to do something similar to what we had CruiseControl doing which was have a centralized server invoke projects (jobs in jenkins) on remote build machines.

We have multiple build machines associated to a single project so when we build the project from the centralized CI server it would invoke the projects on the remote CI servers. The remote CI servers would pull the version from the centralized CI server project.

In CruiseCruise control we setup a project that would do a forceBuild on the remote projects. The projects on the build machines used a remoteProjectLabeller to retrieve the version number so they were always in sync.

To retrieve the master build number:

<labeller type="remoteProjectLabeller">
  <project>MainProject</project>
  <serverUri>tcp://central-server:21234/CruiseManager.rem</serverUri>
</labeller>

To invoke the remote projects:

<forcebuild>
    <project>RemoteBuildMachineA</project>
    <serverUri>tcp://remote-server:21234/CruiseManager.rem</serverUri>
    <integrationStatus>Success</integrationStatus>
</forcebuild>

So far in jenkins i've setup a secondary server as a slave using the java web start but I don't know how I would have the master jenkins invoke the projects setup on the slaves.

Can I setup Jenkins to invoke projects (jobs) on slaves?

Can I make the slaves pull the version number from the master?

EDIT -

Let me add some more info.

  • The master, and remote build machine slaves are all running Windows.
  • We had the central master CruiseControl kick off the remote projects at the same time so they ran concurrently and would like to have the same thing with jenkins if possible.
like image 977
Andy Arismendi Avatar asked May 01 '12 19:05

Andy Arismendi


People also ask

How do I run a Jenkins job remotely?

Developers can follow these three steps to implement a remote Jenkins build trigger: Create a Jenkins build job and enable the Trigger builds remotely checkbox. Provide an authentication token; This can be any text string of your choice. Invoke the Jenkins build URL to remotely trigger the build job.

How trigger Jenkins job from another Jenkins?

You can follow the below steps to trigger a Jenkins pipeline in another Jenkins pipeline. Select a job that triggers a remote one and then go to Job Configuration > Build section > Add Build Step > Trigger builds on remote/local projects option.

What is Jenkins master?

Jenkins Master. The Jenkins master is in charge of scheduling the jobs, assigning slaves, and sending builds to slaves to execute the jobs. It'll also keep track of the slave state (offline or online) and retrieve the build result responses from slaves and display them on the console output.


1 Answers

Jenkins has the concept of build agents, which could perhaps fit your scenario better - there's a master that triggers the build and slaves that perform it. A build can be then restricted to some categories of slaves only (e.g. if it depends on a specific software, not present on all agents). All data is managed centrally by the master, which I believe is what you are trying to achieve.

like image 96
skolima Avatar answered Sep 19 '22 03:09

skolima