running jobs in parallel using workflow plugin

85 views
Skip to first unread message

Ohad Basan

unread,
Aug 25, 2015, 4:21:16 AM8/25/15
to Jenkins Users
Hello

I am trying to use workflow plugin to run a specific job 5 times concurrently and then wait for all of the jobs to finish.
this is the groovy snippet.

def concurrent=[:]
for (int i = 0; i < 6; i++) {
  concurrent["concurrent${i}"] = {
    build job: 'test_job', parameters: [[$class: 'StringParameterValue', name:'queue', value:     
    'automation_prod.q']]
    }
}
parallel concurrent

the result is the job running only once.
what am I doing wrong?

thanks

Ohad

Daniel Beck

unread,
Aug 25, 2015, 4:32:49 AM8/25/15
to jenkins...@googlegroups.com
Jenkins will collapse multiple queue items with identical parameters into one. Make sure to pass different parameters.
> --
> 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-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/cce83e26-4dbc-462a-b640-5e63cf91c0a8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Ohad Basan

unread,
Aug 25, 2015, 4:53:25 AM8/25/15
to Jenkins Users, m...@beckweb.net
this is problematic for me.
I need to trigger the same job 5 times with the same parameter value?
it's not possible in any way?
if not I will hack it at the job level...

Ginga, Dick

unread,
Aug 25, 2015, 7:15:21 AM8/25/15
to jenkins...@googlegroups.com

You could add a parameter that the job does not use just so that the set of parameters is different for each.

Ohad Basan

unread,
Aug 26, 2015, 8:34:24 AM8/26/15
to Jenkins Users
still no good
I tried it like this


def concurrent=[:]
for (int i = 0; i < 6; i++) {
  concurrent["concurrent${i}"] = {
    build job: 'test_job', parameters: [[$class: 'StringParameterValue', name:'queue', value:     
    'automation_prod.q'],[$class: 'StringParameterValue', name:'dummy', value: "${i}"]]
    }
}
parallel concurrent

this way the value of the 'dummy' variable always changing.
Reply all
Reply to author
Forward
0 new messages