Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53658

Clarify conditions to use Declarative Pipelines in your shared libraries

XMLWordPrintable

      The documentation in

      https://jenkins.io/doc/book/pipeline/shared-libraries/#defining-declarative-pipelines

      currently says:

      "Only entire pipeline`s can be defined in shared libraries as of this time. This can only be done in `vars/*.groovy, and only in a call method. Only one Declarative Pipeline can be executed in a single build, and if you attempt to execute a second one, your build will fail as a result."

       

      1.  What does it mean "Only entire pipeline`s can be defined in shared libraries"?
      2. It does not mention that the 'call' argument cannot be 'body' in "(...) and only in a call method".  If you try and use body and the DELEGATE pattern the step is just not recognized (so, don't try and make it a DSL step).
      1. the part "Only one Declarative Pipeline can be executed in a single build" is a bit cryptic.  It actually means that currently a pipeline cannot start another pipeline.
      2. As a consequence of (3) above, one can currently only use a library pipeline step from a  non-declarative, scripted pipeline.  It is not possible to use it from a declarative pipeline in your Jenkinsfile or job configuration.
      3. The example of calling lacks a bit of context so it does not help clarifying (3) and (4) above.

            Unassigned Unassigned
            fnasser Fernando Nasser
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: