-
Improvement
-
Resolution: Unresolved
-
Major
-
None
With 1.2 a grat new feature was created, library "pipeline templates", which prevents very similar pipelines to be duplicated in many places (a maintenance nightmare, and makes it difficult to enforce organization-wide processes).
However it still has some limitations (see https://issues.jenkins-ci.org/browse/JENKINS-53658) One of these, however, is really damaging.
Currently one cannot use the library pipeline from a declarative pipeline (jenkinsfile for instance) and this error happens:
java.lang.IllegalStateException: Only one pipeline { ... } block can be executed in a single run.
This forces the use of scripted pipelines to use them, which undermines the efforts to use preferably declarative ones.
It would be alright to put some limits on this. We don't need arbitrary levels of nesting. But at least being able to call a library declarative pipeline from the main declarative pipeline should be possible. Not sure if this simplifies anything in terms of implementation, but could limit use of resources (memory etc.).
Note: Before someone says this, it is still useful to use the library pipeline templates from very small scripted ones that basically just provide the parameters for the specific library pipeline use. I am doing this. But to get a process pipeline that uses several standardized subprocesses in the form of library pipelines one should not be restricted to make the Jenkinsfile one a scripted one.