Can it be multibranch project under Github Organization if repository's few branches (not All) are having Jenkinsfile


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.

There are 3 different job types

  1. Pipeline - Can be either an SCM[1] repo with a Jenkinsfile[2] or typed into a text box.
  2. Multibranch pipeline - Given an SCM[1:1] repo, scan all branches (given criteria) and create one job for each Jenkinsfile[^1] found.
  3. 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.

  1. All scm integrations should support the same behaviors, but I’ve only worked with git/github ↩︎ ↩︎

  2. By default Jenkinsfile has to be at the top level of the provided scm, but plugins/config can change that ↩︎ ↩︎ ↩︎