this work as I expect
stage("paralelo"){
def paralelo=[:]
for(def counter=1;counter<6;counter++){
def value=counter
paralelo["branch${counter}"] = {
print "hello ${value}"
if(value==5){
error 'died'
}
}
}
catchError{
parallel paralelo
}
}
but if we move
def value=counter
inside
paralelo["branch${counter}"] = {
all the parallel executions get the same value in $counter variable (last
value)
anybody could explain me what exactly is happening?
Thank you
--
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/f8510935-06de-4486-91f4-b7117cc4c3c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.