Jenkins: Skip Build If No Changes Found

10,337

You can use "Poll SCM" option under the Build Triggers section.

Once above option is selected you will be able to set Schedule for polling.

Say for eg. if you set schedule to be @hourly then Jenkins will poll SCM(TFS in this case) every hour and look for changes, if there are any it will build the job else it will not.

In addition to (@yearly, @annually, @monthly, @weekly, @daily, @midnight, and @hourly) Schedule field follows the syntax of cron i.e MINUTE HOUR DOM MONTH DOW

Examples:

every fifteen minutes -> H/15 * * * *

Share:
10,337
Eric
Author by

Eric

Working on build/release management and deployment using nANT/MSBUILD, CruiseControl.net, Team Foundation Server, Powershell, Jenkins build server, Atlassian tool stack (Bamboo, BitBucket, JIRA, etc.)

Updated on June 04, 2022

Comments

  • Eric
    Eric almost 2 years

    I am using Jenkins to build a large .NET-based solution tied in to TFS. The first step in the script is to get the latest change sets from TFS, then build the solution. In some other tools I've used, there were options to skip the build if no new changes were found in TFS. Does a similar feature exist in Jenkins? Seems kind of silly to rebuild the entire solution and deploy it if there is nothing new since the last build.

    • PatrickLu-MSFT
      PatrickLu-MSFT almost 6 years
      Hi Eric, any update on this thread, have you figured it out? If my reply helped or gave a right direction. Appreciate for marking it as an answer which will also helps others in the community.