Interview Prep/Jenkins/Shared libraries & multibranch

A new org with 150 repositories wants Jenkins builds for every repo with a Jenkinsfile, without tickets to the platform team. What do you set up?

IntermediateScenarioShared libraries & multibranch
Answer

Situation read → Organization folder use case.

What I'd do →

  1. Create a GitHub Organization folder with a GitHub App credential, defined in JCasC/Job DSL (organizationFolder('acme') { organizations { github { repoOwner('acme') ... } } }).
  2. Discover repos with a Jenkinsfile, branches excluding PR branches, PRs merged with target, forks trusted only from collaborators.
  3. Configure an org-level webhook to /github-webhook/.
  4. Apply folder-level credentials and permissions for the org.
  5. Set orphaned item strategy and a periodic scan (1 day) as backup.

Why → New repos are picked up automatically and builds start on the first push.

Interview tip → Mention GitHub App rate limits as the reason not to use a personal token at this scale.

All Jenkins questions Roadmap: Jenkins

More on Shared libraries & multibranch