Vladimir Sinenko
Vladimir Sinenko

Reputation: 4667

Jenkins: update SCM without triggering a build?

We have an SCM-controlled project that polls a repo every several minutes. Overall the workflow is great but occasionally I need to push the new changes to the server's repository without triggering a build in Jenkins (for various reasons: long builds, minor changes, concurrent commits etc).

I have already set up a quiet period, and sometimes I just start and stop the build (which is awkward), so the Jenkins pulls the changes and does not trigger the build later.

So, is there a plugin of any sort that allows either:

Upvotes: 4

Views: 6552

Answers (3)

malenkiy_scot
malenkiy_scot

Reputation: 16605

Another idea (not necessarily a better one, but it may better suit your tastes): use Run Condition Plugin. Make the rest of your build conditional on a parameter (let's name it DO_BUILD). Set that parameter to TRUE by default. If you need to commit something without triggering the build set DO_BUILD default to FALSE.

A variation on the same idea: you do your polling in one job (Trigger) that calls your main job via Parameterized Trigger Plugin in a build step. That build step is then can be conditioned upon a parameter. Note that in this case you will either have to use the same custom workspace for both builds, or do a manual check out (say, in a shell build step) in the main job.

Upvotes: 1

Cédric Julien
Cédric Julien

Reputation: 80761

You have many solutions to do this :

  1. Instead of polling your SCM and trigger a build on change, you can do it another way. You can make your SCM decide if the commit should trigger a job or not. Have a look there for an example
  2. You could try to use the "Excluded Commit comments" property in Subversion extended properties of your job, this way, you could avoid to trigger builds on "useless commits".

Upvotes: 7

eyossi
eyossi

Reputation: 4340

Take a look at that: https://wiki.jenkins-ci.org/display/JENKINS/PollSCM+Plugin

you should configure the build trigger as "Build periodically" (without "Pool SCM" trigger) only and i think that might do the job

Upvotes: 2

Related Questions