Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running sequentially job tasks on several environments using Jenkins

I'm new to Jenkins. I'm trying to implement a specific scenario in a single job to build mobile applications using Jenkins.

In a single job I want to launch several tasks sequentially: Task 1 (Windows) ---> Task 2 (Windows) ---> Task 3 (Windows) ---> Task 4 (Mac OSX)

Each job will be dedicated to a single project. Passing results from a task to another can be realised through the workspace, but it seems that job tasks must all run on the same environment. Is there any plugin that will let me run some tasks of the job in a particular slave ?

Thanks in advance

like image 202
ridan Avatar asked Jul 18 '12 14:07

ridan


2 Answers

You could use trigger builds remotely on your slave jobs. Then from the master job you can execute slave builds using curl. Like this:

$(curl --user "username:password" "http://jenkins.yourdomain.org/job/JOB-name/buildWithParameters?SOMEPARAMETER=$SOMEPARAMETER&token=TheSecretToken")

TheSecretToken is the token password you specified on your slave plugins. And username:password is a valid user on your jenkins. Don't use your own account here but rather a 'build trigger' account that only has permissions to start specific jobs.

like image 167
Arnestig Avatar answered Oct 18 '22 16:10

Arnestig


  1. Define a job for each task you have mentioned.

  2. Have a slave on the remote machine(s) - presumably the Mac.

  3. In each job, set the relevant host that will run it (you have a parameter for that).

  4. Use the "trigger parameterized build" plugin to trigger the jobs in the correct sequence, and make sure you pass "Current build parameters" in that section.

  5. This plugin will allow you to pass other values as well - read its help for more details.

like image 37
Gonen Avatar answered Oct 18 '22 16:10

Gonen