Interview Prep/Jenkins/Shared libraries & multibranch

You must migrate 80 Freestyle jobs to multibranch pipelines. Plan it.

IntermediateScenarioShared libraries & multibranch
Answer

Situation read → Large migration; reduce risk and repetition.

What I'd do →

  1. Inventory jobs with the API (/api/json?tree=jobs[name,_class]) and group by pattern (Maven app, Node app, cron script).
  2. Build library steps or templates for each pattern.
  3. Add Jenkinsfiles via automated PRs, generating the parameters from each job's config.xml.
  4. Create multibranch jobs via Job DSL in JCasC; run both old and new in parallel for a week, comparing results.
  5. Disable Freestyle jobs, then delete after a retention period.

Why → Pattern-based templates make the 80 jobs mostly mechanical, and parallel running catches gaps.

Interview tip → Mention the cron/admin jobs might stay as simple pipelines, not every job needs multibranch.

All Jenkins questions Roadmap: Jenkins

More on Shared libraries & multibranch