I am currently using a Multibranch pipeline in Jenkins. My Project repository contains a Jenkinsfile at its root so every time I create a new branch, Jenkins automatically detects it and runs the pipeline which works fine.
However, I'm questioning whether this is the right approach. Every branch ends up with its own copy of the `Jenkinsfile`, and keeping them all in sync can become painful as the project grows.
I'm considering an alternative: having a **separate, dedicated repository** that contains only the `Jenkinsfile`, which would clone the project repository and checkout the target branch passed as a parameter.
My questions are:
- Is this a recognized good practice?
- What are the trade-offs between both approaches (co-located vs. centralized Jenkinsfile)?
- Are there Jenkins-native features (Shared Libraries, etc.) that address this better?
Thanks in advance!
------------------------------
Adeel Bablu
------------------------------