Search code examples
jenkinsjenkins-agent

How can I select some projects to be eligible to be built by agents


I've created successfully my 1st Jenkins agent, but I don't want to be used to all the projects, so I've chosen the {{Only selected projects}} option.

But how can I choose the projects? I've looked at Jenkins management, and the configuration of a project, and I don't see the needed setting.


Solution

  • You tie jobs to slaves in the jobs' configuration: go to ${jenkins url}/job/${job name}/configure and look for the Restrict where this project can be run field in the general settings:

    Restrict where this project can be run

    You can type names of slaves there, or even better, use tags assigned to slaves. You can use logical expressions like || and &&, too.