A Possible workaround to the solution is to check the ${GIT_COMMIT} and ${GIT_PREVIOUS_COMMIT} variables in a job and then based on the outcome of this job, trigger the actual job as a downstream. This would require "Run Condition Plugin" (https://wiki.jenkins-ci.org/display/JENKINS/Run+Condition+Plugin)

Steps:
1. Install the Run Condition Plugin
2. Create a Test Job, which would Poll SCM in the required interval. As a condition in the test job, you can configure to test for a "Strings Match" condition and as a result, in the "Steps to run if condition is met" option, you can execute a windows batch command "exit 1", which will simply fail this test job if the Git current commit and Previous commit matches (a possible duplicate build triggered in Jenkins).
3. If these commits do not match, then it is a valid candidate for execution and the actual job that you want to execute can be called in the "Post Build Action". So essentially, you are checking the current and previous commit and aborting the test job, if they are same, and proceed to build the actual job, if the commits are different.

Let me also try to attach a screen shot for help. Please try out and see if this going to help.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to