Uncodemy Logo ← Back to Course
Jenkins · Topic 5 of 15

Triggering Jenkins Jobs

Ways to Trigger a Jenkins Job

A Jenkins job can be triggered either manually or automatically. There are three common automatic triggers:

  1. GitHub Webhook
  2. Build Periodically
  3. Poll SCM

1. WebHooks

Whenever a developer commits code, the change is automatically applied on the server — this is achieved using WebHooks.

Setting up a webhook from GitHub

Repository → Settings → Webhooks → Add webhook

Then, in Jenkins: Job → Configure → Build Triggers → check "GitHub hook trigger for GITScm polling" → Save.

2. Build Periodically

Job → Configure → Build Periodically. This runs on CRON syntax.

The cron format has 5 stars: * * * * *

Example: Aug 28, 11:30 AM, Sunday build → 30 11 28 08 0

* * * * * means a build every single minute. */5 * * * * means every 5 minutes. For reference, use the website crontab.guru.

Note: with Build Periodically, the build happens on schedule whether the code changed or not.

3. Poll SCM

Also based on cron syntax, but only runs a build if there's an actual change in the GIT repo within that window.

Quick Comparison

TriggerBehaviourScope
WebhooksBuild happens the instant a commit is pushedOnly works with GIT/GitHub
Poll SCMChecks periodically, builds only if changes existOnly works with GIT
Build PeriodicallyBuilds on a fixed schedule 24x7, regardless of changesWorks for any DevOps tool, not just Git

Master Jenkins & DevOps with Uncodemy

Hands-on live training, real projects, and placement support — become job-ready in DevOps.

Enroll in DevOps Training →