Multibranch Pipeline Inline Definition

This plugin allows defining a central Jenkins Pipeline for all jobs in a multibranch pipeline or even organization folder.

Configuration

The plugin adds:

  • A Project recognizer for organization folders called Common pipeline definition for markerfile

  • A Mode for multibranch pipelines called Common pipeline definition for markerfile

Both have the same options:

  • A Markerfile that needs to be present in the repository for a project to be created for the branch in Jenkins. A common example in the Jenkins project would be the pom.xml file indicating a Maven project.

  • The only other option is a text field for a Pipeline DSL Script.

Note
A common way to version-control the Pipeline DSL here is to have it be a one-liner that calls a function defined in a shared library.

Differences from Pipeline Multibranch Defaults Plugin

This plugin was initially developed for internal use by the Jenkins security team while Pipeline Multibranch Defaults Plugin only existed in its flawed 1.x implementation.

While this plugin was released only much later, when version 2.0 of Pipeline Multibranch Defaults Plugin existed, it still has a few minor benefits compared to that plugin:

  • No legacy code supporting the flawed 1.x implementation (as of version 2.1 of that plugin)

  • No dependency on Config File Provider Plugin