@Override
  public void queueJob(String path) throws NameNotProvidedException {
    validateNameArg(path);

    BuildableItem project = lookupStrategy.getItem(build.getParent(), path, BuildableItem.class);

    LOGGER.log(
        Level.INFO, format("Scheduling build of %s from %s", path, build.getParent().getName()));
    project.scheduleBuild(new Cause.UpstreamCause((Run) build));
  }
예제 #2
0
  public void fireEvent(Run<?, ?> run, ReactorEvent event) {
    for (Job j : Jenkins.getInstance().getAllItems(Job.class)) {
      ReactorJobProperty rjp = (ReactorJobProperty) j.getProperty(ReactorJobProperty.class);
      if (rjp != null && !run.getParent().equals(j)) {
        StringScriptSource scriptSource = new StringScriptSource(rjp.reactorScript);

        ReactorGroovy rg = new ReactorGroovy(scriptSource);

        try {
          if (rg.perform(event)) {

            ((BuildableItem) j).scheduleBuild(new ReactorCause(event));
          }
        } catch (Exception ex) {
          ex.printStackTrace();
        }
      }
    }
  }