I have been looking for something similar where a library call could be triggered unconditionally for every single pipeline in order to inject bootstrapping or validation logic. So far this seems to be near impossible without the creation of a custom plugin in Java. The best you might be able to do is to add a CI check on all your jenkinsfiles and grep to ensure that the call you require is included in all jenkinsfiles. This is far from being bullet proof, but can help capture most of this.
sodul
(Stephane Odul)
2
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Trigger a groovy call in a jenkins library on every pipeline start | 4 | 523 | June 1, 2024 | |
| How can I execute code everytime before my Jenkins pipeline runs | 2 | 3226 | December 9, 2024 | |
| Shared library for declarative stages? | 0 | 382 | May 26, 2024 | |
| "Expected to call ... but woud up catching ..." warning with shared libraries setup | 0 | 170 | June 6, 2025 | |
| Refactoring Declarative Pipelines for Shared Library Use | 2 | 2017 | September 7, 2023 |