Job DSL Plugin

Skip to end of metadata
Go to start of metadata

Plugin Information

Plugin ID job-dsl Changes In Latest Release
Since Latest Release
Latest Release
Latest Release Date
Required Core
1.40 (archives)
Nov 08, 2015
cloudbees-folder (version:4.4, optional)
credentials (version:1.9.4, optional)
vsphere-cloud (version:1.1.11, optional)
config-file-provider (version:2.8.1, optional)
managed-scripts (version:1.2.1, optional)
Source Code
Issue Tracking
Pull Requests
Open Issues
Pull Requests
Justin Ryan (id: quidryan)
Andrew Harmel-Law (id: andrewharmellaw)
Daniel Spilker (id: daspilker)
Matt Sheehan (id: sheehan)
Usage Installations 2014-Nov 1677
2014-Dec 1733
2015-Jan 1883
2015-Feb 2041
2015-Mar 2318
2015-Apr 2447
2015-May 2438
2015-Jun 2704
2015-Jul 2955
2015-Aug 3107
2015-Sep 3465
2015-Oct 3731

The job-dsl-plugin allows the programmatic creation of projects using a DSL. Pushing job creation into a script allows you to automate and standardize your Jenkins installation, unlike anything possible before.


Jenkins is a wonderful system for managing builds, and people love using its UI to configure jobs. Unfortunately, as the number of jobs grows, maintaining them becomes tedious, and the paradigm of using a UI falls apart. Additionally, the common pattern in this situation is to copy jobs to create new ones, these "children" have a habit of diverging from their original "template" and consequently it becomes difficult to maintain consistency between these jobs.

The Jenkins job-dsl-plugin attempts to solve this problem by allowing jobs to be defined with the absolute minimum necessary in a programmatic form, with the help of templates that are synced with the generated jobs. The goal is for your project to be able to define all the jobs they want to be related to their project, declaring their intent for the jobs, leaving the common stuff up to a template that were defined earlier or hidden behind the DSL.

A bulk of the documentation for this plugin is in the GitHub wiki

Please join the mailing list ( for any user or developer questions.


After installing the plugin, you'll get a new Build Step entry named "Process Job DSLs". Type the DSL directly in the text box, or point to a file in the workspace.


The DSL allows the definition of a job, and then offers a useful set of functions to configure common Jenkins items. A configure is available to give direct access to the config.xml before generating the job. The script is groovy code, which can be very powerful. Here's an example to create a job for each branch in a git repo:

def project = 'quidryan/aws-sdk-test'
def branchApi = new URL("${project}/branches")
def branches = new groovy.json.JsonSlurper().parse(branchApi.newReader())
branches.each {
    def branchName =
    job {
        name "${project}-${branchName}".replaceAll('/','-')
        scm {
            git("git://${project}.git", branchName)
        steps {


  • DSL - Scriptable via Groovy
  • DSL - Direct control of XML, so that anything possible in a config.xml is possible via the DSL
  • DSL - Helper methods for common job configurations, e.g. scm, triggers, build steps
  • Plugin - DSL can be put directly in a job
  • Plugin - DSL can be put into SCM and polled using standard SCM triggering
  • Plugin - Multiple DSLs can be referenced at a time
  • Plugin - Tracks Templates used, will update derivative jobs when template is changed


See the wiki for specific steps and other examples.

  1. Create your set of Jenkins jobs which will serve as the templates (It is a good idea to use a naming convention for these jobs which clearly indicates that these are templates)
  2. Create a Jenkins Job using the Free-style project style to run your DSL Scripts. This is called a "Seed" job.
  3. Configure the seed job, by adding a "Build Step" of type "Process Job DSLs" and paste in the body of the DSL.
  4. Run the seed to generate your new jobs from your script. When successful, and the "build result" page will list the jobs which have been successfully created.
  5. Finally, it is good practice to organise your Jenkins UI with some new tabs so that the management and template jobs are not the first thing a user sees when they login

The tutorial provides explicit steps to use the plugin.


  • Gradle plugin, for creation of jobs from Gradle
  • Additional methods to cover the most common configuration items.


This plugin is started as a hack-a-thon at the Java Posse Roundup#457. It was primarily developed for use at Netflix, but is now used at a wide range of companies and projects. It is licensed under Apache License, Version 2.0.


See Release Notes in the github wiki.


plugin-builder plugin-builder Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Add Comment