I’ve dealt with this problem.  You generate a list of closures, and then run 
the list through parallel.  I’ve changed the constants to protect my employer, 
but the code goes like this:

Jobs_to_build = [ ‘foo’, ‘bar’, ‘baz’, ‘xyzzy’]
  jobs_to_build.each { String job_name ->
      a_closure = { ->
        build(job_name,
        PARAMETER_1: ‘You can add all the parameters you want here as key-value 
pairs’,
        PARAMETER_2: ‘Or just use build(job_name) if they don’t take parameters’
        )
      }
      build_closures.add(a_closure)
    }
    // Run all build jobs for this project/branch tuple in parallel
    parallel(build_closures)
  }
}

From: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of niraj nandane
Sent: Tuesday, November 11, 2014 5:24 AM
To: jenkinsci-users@googlegroups.com
Subject: how to run all jobs in parallel using build flow plugin which are 
stored in string array

Hi,
I want to run the jobs in parallel which are stored in string array using 
build-flow plugin's parallel method.
Any help would be greatly appreciated.
Thanks,
Niraj
--
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<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.


Click 
here<https://www.mailcontrol.com/sr/tyvBwV!0D0bGX2PQPOmvUihCLhWP7Wj9hNznH0s0xN+HlCIE6hbY3M4YnGFX!boy+pKcdHXFkglAlVq5uz6AOA==>
 to report this email as spam.

________________________________
This e-mail and the information, including any attachments it contains, are 
intended to be a confidential communication only to the person or entity to 
whom it is addressed and may contain information that is privileged. If the 
reader of this message is not the intended recipient, you are hereby notified 
that any dissemination, distribution or copying of this communication is 
strictly prohibited. If you have received this communication in error, please 
immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.

-- 
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