The Folders plugin allows you to organize jobs in hierarchical folders, much like how you organize files in directories in your file system.
While this plugin is now open source, it is a foundational element of CloudBees CI.
Jenkins has limited capacity for organizing a large number of jobs or organizing jobs around taxonomies such as projects or departments. Today, most teams group jobs around views on the dashboard, but views are not optimal for understanding custom taxonomies. The Folders plugin addresses this limitation because it helps capture taxonomies in a user environment and helps organize jobs around these taxonomies.
The Folders plugin enables you to create a folder and group related jobs together. These jobs can be organized around a project, department, sub-department, release or any taxonomy that you choose to define. You can create an arbitrary level of nested folders. Folders are namespace aware, so Job A in Folder A is logically different from Job A in Folder B
The Folders plugin allows you to clone a folder with its children intact. This is useful to seed new projects or jobs with information from a particular project type. Folders can also define properties that are visible to jobs inside them, enabling you to simplify branch and pipeline management.
The Folders plugin is extremely easy to set up and use. Enable the CloudBees Folders plugin in the plugin manager as shown in Installing the Folders plugin. Restart Jenkins to enable the plugin.
Go to New Job, choose Folder as the job type as in Creating a new Folder.
|To replicate an existing folder, choose Copy Existing Job and choose the folder that you want to replicate. This will replicate all jobs and nested folders.|
Sample Taxonomy with Folders plugin shows a potential taxonomy with the Folders plugin. In this example, an organization wants to split its jobs by departments and sub-departments. Here, we have created a folder called "Department A" with a sub-folder for a sub-department. "A very important job" that cross cuts across sub-departments sits at the top level in the department.
The power of the Folders plugin is unleashed with other plugins.
You can use Folders with the CloudBees Role-Based Access Control Plugin to enable folder-level security roles. By default, the roles are inherited by sub-folders.
|You can use the filter mechanism with the RBAC plugin to filter out permissions for a particular sub-folder so that it does not inherit the parent folder roles.|
Using the Template plugin, you can place a template inside a folder rather than at top level. Then the template is only offered to jobs (or other templates) in or below that folder.