Interview Prep/Jenkins/Shared libraries & multibranch

You need a release pipeline that runs when a tag like `v1.4.0` is pushed. Tag jobs appear in multibranch but never build. Make it work.

IntermediateScenarioShared libraries & multibranch
Answer

Situation read → Tags are discovered but not built automatically by default.

What I'd do →

  1. Add the "Discover tags" trait.
  2. Install Basic Branch Build Strategies and add "Tags" with "Ignore tags older than 1 day" plus "Regular branches" and "Change requests" (adding any strategy replaces the default, so list all you need).
  3. In the Jenkinsfile, gate release stages with when { buildingTag() } or when { tag pattern: 'v\\d+\\.\\d+\\.\\d+', comparator: 'REGEXP' }.
  4. Use TAG_NAME as the version.

Why → The age limit prevents a flood of builds for historical tags on first indexing.

Interview tip → Mention that adding build strategies overrides the defaults, a common trap.

All Jenkins questions Roadmap: Jenkins

More on Shared libraries & multibranch