There are multiple projects with similar pipelines.
I can reuse declarative pipeline right now by importing library with pipeline defined:
The problems are:
- This is not officially supported, so can break with any next Jenkins release
- 'when' does not work in this case, so stages are never skipped