Show List

Configuring build triggers

Build triggers in Jenkins allow you to automatically start a build when a specified event occurs. Some common events that can trigger a build are:

  1. Periodic Builds: You can configure Jenkins to build your project at a specified interval, for example, every hour, every day, etc. This is useful for regularly building and testing your code to catch any issues early.

Example: To trigger a build every hour, you can use the "Build periodically" trigger and specify a schedule in the format H * * * *, where H is the hour and * is a wildcard meaning "any".

  1. SCM Polling: Jenkins can periodically poll your source control repository to see if there have been any changes. If changes are detected, Jenkins will start a build.

Example: To trigger a build whenever changes are pushed to your Git repository, you can use the "Poll SCM" trigger and specify a schedule in the format H/15 * * * *, where H/15 means poll every 15 minutes.

  1. Build after other projects are built: You can configure Jenkins to start a build after another project has been successfully built. This is useful for building dependent projects in the correct order.

Example: If you have two projects, "A" and "B", and project "B" depends on project "A", you can configure Jenkins to trigger a build of project "B" whenever project "A" is successfully built.

  1. Build when a change is pushed to a specific branch: You can configure Jenkins to start a build when changes are pushed to a specific branch in your source control repository.

Example: To trigger a build when changes are pushed to the "development" branch in your Git repository, you can use the "GitHub hook trigger for GITScm polling" trigger and specify the branch name as "development".

These are just a few examples of build triggers in Jenkins. You can use any combination of these triggers to build your projects in the way that makes sense for your workflow.


    Leave a Comment


  • captcha text