/** * Schedule a new build for this project. * @see #schedule(Task, int) */ public @CheckForNull WaitingItem schedule(AbstractProject p) { return schedule(p, p.getQuietPeriod()); }
@Override public int getQuietPeriod() { return delegate.asProject().getQuietPeriod(); } @Override public QueueTaskFuture<?> scheduleBuild2(int quietPeriod, Action... actions) {
/** * Computes the delay by taking the default value and the override in the request parameter into the account. * * @deprecated as of 1.489 * Inject {@link TimeDuration}. */ @Deprecated public int getDelay(StaplerRequest req) throws ServletException { String delay = req.getParameter("delay"); if (delay==null) return getQuietPeriod(); try { // TODO: more unit handling if(delay.endsWith("sec")) delay=delay.substring(0,delay.length()-3); if(delay.endsWith("secs")) delay=delay.substring(0,delay.length()-4); return Integer.parseInt(delay); } catch (NumberFormatException e) { throw new ServletException("Invalid delay parameter value: "+delay); } }
continue; boolean scheduled = p.scheduleBuild(p.getQuietPeriod(), new UpstreamCause((Run)build), buildActions.toArray(new Action[buildActions.size()])); if (Jenkins.getInstance().getItemByFullName(p.getFullName()) == p) { String name = ModelHyperlinkNote.encodeTo(p);
/** * Schedule a new build for this project. * @see #schedule(Task, int) */ public @CheckForNull WaitingItem schedule(AbstractProject p) { return schedule(p, p.getQuietPeriod()); }
/** * Schedules a build of this project. * * @return true if the project is actually added to the queue. false if the * queue contained it and therefore the add() was noop */ public boolean scheduleBuild(Cause c) { return scheduleBuild(getQuietPeriod(), c); }
/** * Schedule a new build for this project. * * @return true if the project is actually added to the queue. * false if the queue contained it and therefore the add() * was noop */ public WaitingItem schedule(AbstractProject p) { return schedule(p, p.getQuietPeriod()); }
/** * Schedule a new build for this project. * * @return true if the project is actually added to the queue. * false if the queue contained it and therefore the add() * was noop */ public WaitingItem schedule(AbstractProject p) { return schedule(p, p.getQuietPeriod()); }
/** * Schedules a build of this project. * * @return * true if the project is actually added to the queue. * false if the queue contained it and therefore the add() * was noop */ public boolean scheduleBuild(Cause c) { return scheduleBuild(getQuietPeriod(), c); }
/** * Schedule a new build for this project. * * @return true if the project is actually added to the queue. false if the * queue contained it and therefore the add() was noop */ public WaitingItem schedule(AbstractProject p) { return schedule(p, p.getQuietPeriod()); }
/** * Schedules a build of this project. * * @return true if the project is actually added to the queue. false if the * queue contained it and therefore the add() was noop */ public boolean scheduleBuild(Cause c) { return scheduleBuild(getQuietPeriod(), c); }
@Override public int getQuietPeriod() { return delegate.asProject().getQuietPeriod(); } @Override public QueueTaskFuture<?> scheduleBuild2(int quietPeriod, Action... actions) {
/** * Schedules a build of this project. * * @return * true if the project is actually added to the queue. * false if the queue contained it and therefore the add() * was noop */ public boolean scheduleBuild(Cause c) { return scheduleBuild(getQuietPeriod(), c); }
/** * Schedule a new build for this project. * * @return true if the project is actually added to the queue. * false if the queue contained it and therefore the add() * was noop */ public WaitingItem schedule(AbstractProject p) { return schedule(p, p.getQuietPeriod()); }
/** * Computes the delay by taking the default value and the override in the request parameter into the account. */ public int getDelay(StaplerRequest req) throws ServletException { String delay = req.getParameter("delay"); if (delay==null) return getQuietPeriod(); try { // TODO: more unit handling if(delay.endsWith("sec")) delay=delay.substring(0,delay.length()-3); if(delay.endsWith("secs")) delay=delay.substring(0,delay.length()-4); return Integer.parseInt(delay); } catch (NumberFormatException e) { throw new ServletException("Invalid delay parameter value: "+delay); } }
/** * Computes the delay by taking the default value and the override in the request parameter into the account. */ public int getDelay(StaplerRequest req) throws ServletException { String delay = req.getParameter("delay"); if (delay==null) return getQuietPeriod(); try { // TODO: more unit handling if(delay.endsWith("sec")) delay=delay.substring(0,delay.length()-3); if(delay.endsWith("secs")) delay=delay.substring(0,delay.length()-4); return Integer.parseInt(delay); } catch (NumberFormatException e) { throw new ServletException("Invalid delay parameter value: "+delay); } }
/** * Computes the delay by taking the default value and the override in the request parameter into the account. * * @deprecated as of 1.489 * Inject {@link TimeDuration}. */ @Deprecated public int getDelay(StaplerRequest req) throws ServletException { String delay = req.getParameter("delay"); if (delay==null) return getQuietPeriod(); try { // TODO: more unit handling if(delay.endsWith("sec")) delay=delay.substring(0,delay.length()-3); if(delay.endsWith("secs")) delay=delay.substring(0,delay.length()-4); return Integer.parseInt(delay); } catch (NumberFormatException e) { throw new ServletException("Invalid delay parameter value: "+delay); } }
protected Future schedule(AbstractBuild<?, ?> build, AbstractProject project, List<Action> list) throws InterruptedException, IOException { return project.scheduleBuild2(project.getQuietPeriod(), new UpstreamCause((Run) build), list.toArray(new Action[list.size()])); }
public void consider(Promotion p) { if (appliesTo(p.getParent()) && job != null) { job.scheduleBuild2(job.getQuietPeriod()); } }
public void run() { LOGGER.info("Polling for SCM changes in " + this.project.getName()); PollingResult pollingResult = this.project.poll(this.taskListener); if(pollingResult.hasChanges()) { LOGGER.info("SCM changes found for " + this.project.getName() + ". Triggering build."); if (this.project.scheduleBuild(this.project.getQuietPeriod(), this.cause, buildActions.toArray(new Action[buildActions.size()]))) { LOGGER.info("Build of " + this.project.getName() + " scheduled successfully."); } else { LOGGER.info("No build of " + this.project.getName() + " scheduled - this usually means that another build is already in the queue."); } } else { LOGGER.info(Messages.DownstreamTrigger_NoSCMChanges(this.project.getName())); } } }