This plugin allows defining a central Jenkins Pipeline for all jobs in a multibranch pipeline or even organization folder.
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.xmlfile indicating a Maven project.
The only other option is a text field for a Pipeline DSL Script.
|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.|
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