In a plugin I need to trigger multiple builds of a job in parallel (I have 
defined 4 executors on my slave). I have this:

   
  private TriggerBuilder createTriggerBuilder(List<Job> jobs) throws 
IOException {
    List<BlockableBuildTriggerConfig> configs = new 
ArrayList<BlockableBuildTriggerConfig>();
       for (MyPOJO job : pojos) {

      // to let the caller job do a clean up, don't let the failure in the 
test
      // job early-terminate the build process
      // that's why the first argument is ABORTED.
      BlockingBehaviour blocking = new BlockingBehaviour(Result.ABORTED, 
Result.UNSTABLE, Result.FAILURE);
      List<AbstractBuildParameters> pp = getBuildParameters(job)
      BlockableBuildTriggerConfig blockableBuildTriggerConfig = new 
BlockableBuildTriggerConfig(workerJob, blocking, pp);
      configs.add(blockableBuildTriggerConfig);
    }
    return new TriggerBuilder(configs);
  }

  public void perform() throws IOException, InterruptedException, 
ExecutionException {
    TriggerBuilder createTriggerBuilder = createTriggerBuilder(jobs);
    createTriggerBuilder.perform(build, launcher, listener);




When I have 4 MyPOJOs 4 configs will be added to the TriggerBuilder but 
when I run the main job where this trigger is added they are executed 
sequentially.

How do I execute the 4 BlockableBuildTriggerConfig in parallel?

In the workerJob I have enabled/checked  "Execute concurrent builds if 
necessary"

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

Reply via email to