- Build a job only with one specific user on one particular agent
- CloudBees Jenkins Enterprise
- RBAC plugin
- Authorize Project plugin
- CloudBees Folder
- CloudBees Folder Plus
This job needs to be inside a folder so you can use the CloudBees Folder Plus Plugin to assign the agent to a folder.
Our documentation explains how to assign a folder to an agent step by step.
By default, Jenkins triggers all the builds as SYSTEM user, so in order to configure projects to run with specified authorization you need to install the Authorize Project plugin.
Once the plugin is installed, you need to go to http://<CJE_INSTANCE>/configureSecurity/ and enable Access Control for Builds -> Configure Build Authorizations in Project Configuration -> Run as User who Triggered Build
Now, for each project the following property needs to be enabled:
After this, only users with Agent->Build permission will be able to build on this particular project for a particular agent. Only users with Agent->Build permission will have access to build on any controlled agent.
If you want to isolate the user who has access to a particular job so they cannot build other jobs inside folders with controlled agents, you might want to declare this user at folder level and then assign the Agent->Build permission.
NOTE: In case you are on a CJOC environment notice that the Authorize Project plugin will need to be installed and configured at client master level.