I was going through the jenkins documentation for multibranch project where it’s mentioned that repositories under github organization will be scanned as Multibranch project if contains branches or pull requests having Jenkinsfile.
I believe statement is little vague - does this mean that all branches or pull requests must have Jenkinsfile. As per my understanding it should be atleast one branch or pull request should have Jenkinsfile(It can be more too).
For eg if a repo has 3 branches including master and 2 out of those 3 braches are having Jenkinsfile. isn’t that Multibranch Project ?
Please help me in understanding this if I am missing something.
Pipeline - Can be either an SCM repo with a Jenkinsfile or typed into a text box.
Multibranch pipeline - Given an SCM[1:1] repo, scan all branches (given criteria) and create one job for each Jenkinsfile[^1] found.
Organization Found - Given an SCM organization (kinda github/bitbucket/gitlab only, not sure), scan each repo, look for Jenkinsfile[2:1], and create a job for each Repo and branch where a Jenkinsfile[2:2] is found.
So you don’t need to have jenkinsfile on any branch you don’t want.
Honestly I’d recommend trying it instead of asking how it works.
All scm integrations should support the same behaviors, but I’ve only worked with git/github ↩︎↩︎
By default Jenkinsfile has to be at the top level of the provided scm, but plugins/config can change that ↩︎↩︎↩︎