CloudBees CD domain-specific language (DSL)

On this page

Process-as-code, leveraging the CloudBees CD domain-specific language (DSL), enables you to maintain your release orchestration and deployment model as code that you can store and version in a source control management system. Release managers, product teams, and engineering leaders can design and code release orchestration and deployment automation processes. It provides two-way processing; a model designed and created in the GUI can be exported to code and changes made in code can be imported to the GUI. Process-as-Code allows for simplified and templatized onboarding for consistency at any speed or scale.

The CloudBees CD domain-specific language (DSL) is an intuitive, easy-to-use computer language that allows you to model continuous delivery (CD) and application release automation (ARA) solutions. It has these capabilities:

  • Easy to understand

  • Self documenting

  • Automation-as-code: define your processes as high-level code that can be versioned, tested, and reused.

  • User-defined versions for any object, supporting various means of code reuse.

  • Simple, logical constructs to model any CloudBees CD object.

  • Groovy-based syntax

Why Use DSL?

CloudBees CD DSL is the easiest of the CloudBees CD programming constructs to use.

The following is a comparison of DSL (the easiest to use) and Perl scripts (the most difficult to use):

DSL Perl

Declarative (what)

Script-based, imperative (how)

Concise

Relatively verbose

Understanding of Groovy not needed to read DSL.

Understanding of Perl required.

The entire DSL script is sent only once to the server for evaluation, reducing client-server chattiness.

Each API invocation is separate call to the server, creating client-server chattiness.

The following examples show the helloProcedure in both DSL and Perl along with corresponding CloudBees CD invocation to run the script.

DSL Perl
project "Hello Project", {
    procedure "Hello Procedure", {
    step "Hello World",
    command: "echo 'Hello World
                 from CloudBees DSL!'"
    }
}
use strict;
use ElectricCommander;
$|=1;
my $ec=new ElectricCommander({'format'=>'json'});
$ec->createProject("Hello Project");
$ec->createProcedure("Hello Project",
              "Hello Procedure");
$ec->createStep("Hello Project",
         "Hello Procedure",
         "echo'Hello World from Perl");

ectool evalDsl --dslFile helloProcedure.dsl

ec-perl helloProcedure.pl

You create scripts to model the CloudBees CD objects using the DSL methods and let the CloudBees CD DSL engine take care of invoking the correct API to create or update the object. DSL scripting is based on the Groovy scripting language; however, you do not need to know Groovy in detail to use it.

The benefits of using DSL scripts are:

  • Create one master model or script and run it one or more times for different scenarios to build, test, and deploy your application or microservice by passing different parameter values for evaluating the script.

  • Automate software delivery processes to produce repeatable, scalable, and efficient results.

  • Quickly and easily create and deploy applications or microservices using DSL scripts. Using these scripts enables a higher-order command-line interface (CLI) with richer syntax than the CLI on your system.

  • Quickly learn to create and run DSL to perform specific operations with little to no programming experience. Users do not need to know how to use the CloudBees CD API or UI to create and deploy an application or microservice.

  • Make continuous delivery and continuous integration possible at scale.

For more information about the CloudBees CD DSL, go to: