I can't upvote this enough, this does the trick. I was stuck for a while on
building jobs in parallel based on a dynamically-populated job list.
Nice work.
On Monday, February 17, 2014 at 2:13:35 PM UTC-8, Stuart Rowe wrote:
>
> Hi Rodrigo,
>
> BuildFlow's parallel function takes a list or map of closures - it will
> execute each in parallel.
>
> For your situation, you should iterate over your list of servers, creating
> a
> closure for each and adding it to list. This list can the be passed as an
> argument to parallel().
>
> e.g.
>
> // create a closure for the deploy job for each server
> def serverDeployJobs = []
> for (server in servers) {
> def deployJob = {
> def jobParams = [:]
> // set up params for deploy job on current server here...
>
> // call build
> build(jobParams, DeployProjectName)
> }
> serverDeployJobs.add(deployJob)
> }
>
> // schedule deploy jobs in parallel
> parallel(serverDeployJobs)
>
> Hope that helps,
> Stuart
>
>
>
> --
> View this message in context:
> http://jenkins-ci.361315.n4.nabble.com/Generating-parallel-flow-with-Build-Flow-Plugin-tp4687604p4691098.html
>
> Sent from the Jenkins users mailing list archive at Nabble.com.
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/149be8dc-fa38-4cc5-87e1-a198e6aad7b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.