Skip to content
Browse files
Fix JENKINS-16841
  • Loading branch information
gboissinot committed Feb 24, 2013
1 parent be9e505 commit 49673bf836d6dacb429ba23e8a48f8954d3d7b29
@@ -54,7 +54,7 @@ private void processAndScheduleIfNeeded(TopLevelItem item, Computer c, TaskListe
HudsonStartupService startupService = new HudsonStartupService();
if (startupService.has2Schedule(startupTrigger, node)) {
listener.getLogger().print("[StartupTrigger] - Scheduling " + project.getName());
project.scheduleBuild(0, new HudsonStartupCause());
project.scheduleBuild(startupTrigger.getQuietPeriod(), new HudsonStartupCause());

@@ -22,18 +22,31 @@ public class HudsonStartupTrigger extends Trigger<BuildableItem> {

private String label;

private int quietPeriod;

public HudsonStartupTrigger(String label) throws ANTLRException {
public HudsonStartupTrigger(String label, String quietPeriod) throws ANTLRException {
this.label = Util.fixEmpty(label);
String givenQuietPeriod = Util.fixEmpty(quietPeriod);
if (givenQuietPeriod == null) {
this.quietPeriod = 0;
} else {
this.quietPeriod = Integer.parseInt(quietPeriod);

public String getLabel() {
return label;

public int getQuietPeriod() {
return quietPeriod;

public void start(BuildableItem project, boolean newInstance) {

@@ -1,7 +1,11 @@
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">

<f:entry field="label" title="${%Node Label}">
<f:entry field="label" title="${%Restricted node Label}">
<f:textbox name="label" value="${instance.label}"/>

<f:entry field="quietPeriod" title="${%Quiet period}">
<f:textbox name="quietPeriod" value="${instance.quietPeriod}"/>

@@ -2,7 +2,7 @@
By default, the build is triggered when Jenkins instance starts.<br/>
You can specify a specific a node name or a node label to trigger a build when nodes (whose names or labels
corresponding to the specified value) start. <br/>.
corresponding to the specified value) start. <br/>
You can also specify the 'master' value to refer explicitly to Jenkins master.
@@ -0,0 +1,7 @@
Give the quiet period before scheduling the job.<br/>
The time unit is in seconds.<br/>
'0' is the default value, the job is scheduling without any delay at startup.

0 comments on commit 49673bf

Please sign in to comment.