Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins - restrict where this project can be run option with && (and) option fails

Tags:

jenkins

I have a master and two slaves. When i want a job to run on both the salves i put in this expression in the Restrict where this project can be run option

linux && linux2

I have labelled the nodes correctly. But then the jobs dont run on any machines. I get an error such as Theres no slave/cloud that matches this assignment and the the job is still pending saying it cannot find a label matching the expression. Whats wrong? How can i make it run on both slaves. I do not want to use any other plugin.

like image 470
Müller Avatar asked Mar 13 '23 02:03

Müller


1 Answers

Your expression says that a machine must have two labels: linux and linux2.

You most likely want to say linux or linux2, which would be linux || linux2.
That would mean, when you start a build, that it runs on either one of those two machines.

If you want the build to occur on both machines when you start a build, you could install the Node Label Parameter plugin, mark your job as "This project is parameterized", add a "Node" parameter, choosing linux and linux2 under "Default nodes", and then choose "Execute concurrent builds if necessary", so that builds can happen on both machines at the same time.

like image 89
Christopher Orr Avatar answered May 11 '23 07:05

Christopher Orr