Jay Taylor's notes

back to listing index

Configuration as Code: The Job DSL Plugin

[web search]
Original source (www.cloudbees.com)
Tags: jenkins dsl cloudbees www.cloudbees.com
Clipped on: 2016-03-07

Image (Asset 1/8) alt=
Search

Configuration as Code: The Job DSL Plugin

Submitted by Hannah Inman on 26 Aug 2014
Like
0

This is one in a series of blog posts in which various CloudBees technical experts have summarized presentations from the Jenkins User Conferences (JUC). This post is written by Valentina Armenise, solutions architect, CloudBees. In this presentation, Daniel Spilker, CoreMedia AGs, maintainer of the plugin, shows how to configure a Jenkins Job without using the GUI at JUC Berlin.

Daniel Spilker, from CoreMedia, at the JUC 2014 in Berlin, presented the DSL plugin and showed how the Configuration as a Code Approach can simplify the orchestration of complex workflow pipelines.

The goal of the plugin is to create new pipelines fast and easily using the preferred tools to “code” the configuration as opposite of using different plugins and jobs to set up complex workflows through the GUI.

Indeed, the DSL plugin defines a new way to describe a Jenkins Job configuration by the use of Groovy Language piece of code stored in a single file.

After installing the plugin a new option will be available in the list of build steps: “process JOB DSL” which will allow you to parse the DSL script.

The descriptive groovy file can be either uploaded in Jenkins manually or stored in the SCM and pulled in a specific job.

The jobs whose configuration is described in the DSL script will be created on the fly so that the user is responsible for maintaining the groovy script only.

Image (Asset 2/8) alt=
 
Each DSL element used in the groovy script matches a specific plugin functionality. The community is continuously releasing new DSL elements in order to be able to cover as many plugins as possible.
 
Image (Asset 3/8) alt=

Of course, given the +900 plugins available today and the frequency of new plugin releases, it is fairly impossible that the DSL plugin covers all use-cases.

Here comes the strength of this plugin: although each Jenkins plugin need to be defined by a DSL element, you can create your own custom DSL element by the use of the method configure which gives direct access to underlying XML of the Jenkins config.xml. This means that you can use DSL plugin to code any configuration even if a predefined DSL element is not available.
 
The plugins gives also the possibility to introduce custom DSL commands.
 
Given the flexibility of the DSL plugin, and how fast the community is in realizing new DSL elements (a new feature every 6 weeks), this plugin seems to be a really interesting way to put Jenkins configuration into code.
 
Want to know more? Refer to:
 

Image (Asset 4/8) alt=

Valentina Armenise
Solutions Architect, CloudBees

Follow Valentina on Twitter.
  

 

 

 

 

Add new comment

Your name
E-mail

The content of this field is kept private and will not be shown publicly.

Homepage
Subject
Comment *

Categories

Archive

2016

March (2)

February (5)

January (6)

2015
2014
2013
2012
2011
2010