I am using a similar configuration as OP, except that multiple *different* 
jobs must be ran in parallel.  I have two separate build jobs (test1 and 
test2)  that are being fed into the parallel function and rather than 
running jobs test1 and test2, it is running test2 twice.  In my case the 
jobs will be different, but the parameter (version) that is passed to the 
jobs will not change. 

*Here is the code:*

version = "4.1.0" 
println "Deploying version " + version 
def components =  ["test1,test2"] 
println components 
def component = components.get(0) 
println component 
def values = component.split(',') 
def jobsInParallel = []; 
for ( myComponent  in values ) { 
  println myComponent 
  def parallelJob = { 
    def jobParams = [:] 
    jobParams = myComponent 
    println jobParams 
    build (jobParams,Version:version) 
  } 
  jobsInParallel.add(parallelJob) 
} 
parallel(jobsInParallel)


*And here is the Console output:*

Deploying version 4.1.0
[test1,test2]
test1,test2
test1
test2
parallel {
test2
test2
    Schedule job test2
    Schedule job test2
    Build test2 #1 started
    Build test2 #1 started
    test2 #1 completed 
    test2 #1 completed 
}
Finished: SUCCESS



Any ideas on why the test1 job isn't being included in the parallel build? 
 Any help would be appreciated. 

Thank You, 

Jay


On Monday, February 17, 2014 at 4:13:35 PM UTC-6, 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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/075f36ab-eb3e-4e1c-97b3-c724b5eb635b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to