-
Improvement
-
Resolution: Unresolved
-
Major
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."
- What does it mean "Only entire pipeline`s can be defined in shared libraries"?
- 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).
- 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.
- 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.
- The example of calling lacks a bit of context so it does not help clarifying (3) and (4) above.