提交 b65c30cb 编写于 作者: C Christoph Kutzinski

Switch to ignore post-commit hook in SCM polling triggers [FIXED JENKINS-6846]

上级 41f1fe66
......@@ -58,6 +58,10 @@ Upcoming changes</a>
<li class=bug>
Slave's Name should be trimmed of spaces at the beginning and end of the Name on Save.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-15836">issue 15836</a>)
<li class=rfe>
Added new switch to ignore post-commit hooks in SCM polling triggers.
This requires that the SCM plugin supports this feature, too!
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-6846">issue 6846</a>)
</ul>
</div><!--=TRUNK-END=-->
......
......@@ -73,9 +73,28 @@ import static java.util.logging.Level.*;
* @author Kohsuke Kawaguchi
*/
public class SCMTrigger extends Trigger<SCMedItem> {
@DataBoundConstructor
private boolean ignorePostCommitHooks;
public SCMTrigger(String scmpoll_spec) throws ANTLRException {
this(scmpoll_spec, false);
}
@DataBoundConstructor
public SCMTrigger(String scmpoll_spec, boolean ignorePostCommitHooks) throws ANTLRException {
super(scmpoll_spec);
this.ignorePostCommitHooks = ignorePostCommitHooks;
}
/**
* This trigger wants to ignore post-commit hooks.
* <p>
* SCM plugins must respect this and not run this trigger for post-commit notifications.
*
* @since 1.493
*/
public boolean isIgnorePostCommitHooks() {
return this.ignorePostCommitHooks;
}
@Override
......
......@@ -27,4 +27,7 @@ THE SOFTWARE.
<f:entry title="${%Schedule}" help="/descriptor/hudson.triggers.TimerTrigger/help/spec">
<f:textarea name="scmpoll_spec" checkUrl="'${rootURL}/trigger/TimerTrigger/check?value='+encodeURIComponent(this.value)" value="${instance.spec}"/>
</f:entry>
<f:entry field="ignorePostCommitHooks" title="${%Ignore post-commit hooks}">
<f:checkbox />
</f:entry>
</j:jelly>
<div>
Ignore changes notified by SCM post-commit hooks.
<p>
This can be useful if you want to prevent some long-running jobs (e.g. reports) starting because of every commit, but still want to
run them periodic if SCM changes have occurred.
<p>
Note that this option needs to be supported by the SCM plugin, too! The subversion-plugin supports this since version 1.44.
</div>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册