Interview Prep/Jenkins/Multibranch, organization folders & webhooks

How do you handle a monorepo where each service should build only when it changes?

AdvancedConceptMultibranch, organization folders & webhooks
Answer

Options:

  1. One multibranch job per service with its own script path and when { changeset 'services/api/**' } on every stage (simple, but every push indexes every job).
  2. One pipeline that computes changed paths (git diff --name-only origin/main...HEAD) and builds a dynamic parallel map for affected services.
  3. A build tool that understands the graph (Nx, Bazel, Gradle) invoked once.

Note that changeset compares against the previous build of the branch, so the first build of a new branch sees no changeset and may skip everything; handle that case explicitly.

All Jenkins questions Roadmap: Jenkins

More on Multibranch, organization folders & webhooks