Interview Prep/CI/CD/Jenkins Pipelines and Agents

You need a pipeline to build a branch automatically on push without polling. How do you wire it?

BeginnerScenarioJenkins Pipelines and Agents
Answer

Situation read → Polling SCM wastes load and adds delay.

What I'd do →

  1. Use a Multibranch or Organization folder job with the GitHub Branch Source plugin.
  2. Add a webhook in the repo to https://jenkins.example.com/github-webhook/ (or /multibranch-webhook-trigger/invoke?token=...).
  3. Keep a long periodic scan (for example 1 day) only as a safety net.

Why → Push events trigger within seconds, and the controller does not poll hundreds of repos.

Interview tip → Mention that the webhook endpoint must be reachable from the SCM, so check ingress and firewall.

All CI/CD questions

More on Jenkins Pipelines and Agents