Modernize your pipelines with best practices built-in

Version:Starting with 2.222.2.1

Who needs it?

Developers who are tasked with creating and maintaining pipelines want reliable, repeatable builds.

The problem

Freestyle jobs are common among Jenkins users as they are limitlessly flexible. They can also be easy to abuse, difficult to maintain, introduce incompatibility and worst of all, shared libraries with complex scripting can jeopardize the stability of the controller. Translating these jobs into more modern pipelines is time consuming and error prone.

CloudBees can help

We know that a lot of love went into those Freestyle jobs, so we needed to find a way to translate that work to the closest approximation into a Declarative Pipeline. And for pipelines that are translated to Declarative or build that way from scratch, we need to ensure maintainability. As the authors of the Jenkins Declarative Pipeline syntax, CloudBees can help.

The solution

Declarative Pipelines provide a more modern, opinionated approach. The resulting Jenkinsfile can then be committed to a Git repo in a ‘pipeline as code’ fashion. We are here to help developers using Jenkins and CloudBees CI make the most of your pipelines. To increase adoption and use of Declarative Pipelines, CloudBees supports the Declarative Pipeline Migration Assistant as part of our CAP program of certified plugins.

The Declarative Pipeline Migration Assistant plugin is a tool to convert Freestyle pipelines into Declarative Pipelines. This plugin creates a Jenkinsfile that includes predictable configurations, structure, policies, rules and conditions for supported plugins with placeholder stages for plugins not yet supported. This plugin helps alleviate the tedious manual effort of translating pipelines which is prone to human error and time consuming to troubleshoot.

How we do it better

A key value for using Declarative Pipelines is the ability to easily maintain them. This is an especially tall order when faced with maintaining multiple configurations of larger, more complex pipelines. The Declarative Pipeline Matrix feature allows users to specify a list of stages once and then run that same list in parallel on multiple configurations. The new matrix section executes a set of one or more Pipeline stages multiple times - once for every combination defined in the matrix. Matrix combinations are generated from static lists of predefined values. Filters can also be provided to exclude specific combinations. With the Matrix feature, users no longer have to make changes in multiple places throughout the pipeline. An equivalent pipeline created without Matrix would easily be several times larger, and much harder to understand and maintain.

With CloudBees CI, developers can easily create Declarative Pipelines, migrate their existing Freestyle jobs to Declarative, and easily maintain those pipelines using ‘pipeline as code’.

Use cases

Developers can:

  • Quickly translate freestyle pipelines into declarative pipelines with correct syntax automatically generated for supported plugins using the Declarative Pipeline Migration Assistant.

  • Propagate actions across multiple configurations using Declarative Pipeline Matrix.