I have a Jenkins server with a good number of jobs. Recently, I decided to implement slave servers to reduce the server load. Everything went fine until I had this new requirement. Almost all of the java jobs are compiled with OpenJDK 7. Now there are some new projects requiring to be compiled with open jdk 8 and sun jdk 7 and 8. I decided to install new slaves with openjdk 8 and sun jdk 7 and 8 (three separate slaves) and assign those jobs with those requirements using the 'Restrict where this job can be run'option. However, how can I prevent the existing jobs from getting compiled in the new slaves (i.e. I want them to be compiled on the slaves with openjdk 7)?
Master Jenkins is 1.598 running on Redhat 6.5.
I found the answer myself. The slave jar, as found in this page, takes two arguments - mode and label. I start those slaves where the jobs to be prevented from running, with an 'exclusive' mode (and a specific label). On the master side I assigned those jobs for those slaves using the 'Restricted to <label>' option. Normal slaves run with a 'normal' mode where any un-restricted jobs can be run. Please let me know if the answer(and/or the question/requirement) is not clear.