Thank you all for the clarification.
Am Montag, 13. März 2017 15:26:44 UTC+1 schrieb Martin Schmude: > > Hello, > > I have a freestyle job with one step of the kind "Execute Groovy Script". > Its Groovy code is > > def x = ['a', 'b', 'c'] > println x > x.each { println it } > > > The output of this job is (not surprinsingly): > > [Test-Groovy2] $ groovy > /var/lib/jenkins/workspace/Test-Groovy2/hudson3825239812036801886.groovy > [a, b, c] > a > b > c > Finished: SUCCESS > > > But if I create a pipeline job with the pipeline script set to the same > Groovy code, its output is: > > [Pipeline] echo[a, b, c][Pipeline] echoa[Pipeline] End of PipelineFinished: > SUCCESS > > > The .each() gets the first element in the list and nothing more. > What's going on here? I thought that pipeline scripts are just Groovy plus > some pipeline DSL, but I seem to be wrong. > > BTW: my Jenkins is 2.27. > > -- 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/b3fb9d74-feb4-448c-841d-559a7a33ad32%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.