registeries = [1,2,3,4] 
 Map tasks = [:]
 for (j=0;j<=registeries.size();j++) 
{ 
 tasks["Code ${j}"] = { -> sh "touch ${j}" }
 } 
 parallel(tasks) 
 sh "ls -lrt"

  

Above code should create files 0,1,2,3,4,5

but the last line ls -lrt only prints 5 which means it is only taking the 
last iteration value in all values of map tasks

Can anyone tell what I am doing wrong here ?

-- 
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/bfde4364-d93d-4b7a-9ff6-7b2e7bd3c7a2n%40googlegroups.com.

Reply via email to