Multibranch pipeline with a single Jenkinsfile version

Jenkins setup: 4.246.3, Gitea SCM

We have a declarative multi-branch pipeline (under an organisation), that is currently in a bit of a mess. There are a hundred or so branches, many of which are (theoretically) frozen.

We want to do some major cleanups to the Jenkins configuration and Jenkinsfile (add new stages, move to container builds, re-arrange agents, suppress building of archived branches, and the like). We can (and have) made some changes to the controller branch, and these changes are applied to any new branch or when a merge is done on an existing branch, but most existing branches don’t see those changes .

Is there a way to configure a multi branch pipeline to use a single Jenkinsfile version for all (or most) branches? Are there any other tricks I might try that doesn’t involve committing new Jenkinsfiles to a hundred branches every time we change something?

Using remote Jenkins file provider plugin. I think for now it’s ok for my use case

Thanks Michael & Markus, those suggestions look like just the thing.

1 Like