Was aware of it. Iterating for loops using for(def foo : foos) will work
for List. Using closure forEach does not work in Pipeline without using
@NonCPS.
>
>- Beware for (Foo f: foos) loops and Groovy closure-style operators
>like .each and the like. They will not work right in normal P
And of course in methods marked as NonCPS, you can not use jenkins steps
(e.g. sh).
Björn
--
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+uns
See
https://github.com/jenkinsci/pipeline-examples/blob/master/docs/BEST_PRACTICES.md#groovy-gotchas
Am Montag, 31. Oktober 2016 12:22:08 UTC+1 schrieb Sverre Moe:
>
> Problem looping through the result of findFiles.
> The result from this method returns a
> org.jenkinsci.plugins.pipeline.uti
Problem looping through the result of findFiles.
The result from this method returns a
org.jenkinsci.plugins.pipeline.utility.steps.fs.FileWrapper
node {
stage("Publish") {
def files = findFiles(glob: '**/*.rpm')
for (def file : files) {
sh "echo Hello Wor