-
Bug
-
Resolution: Unresolved
-
Minor
-
None
When I tried to parse Maven output (which is running using sh -step), noticed that groovy code only sees first line of output. Example pipeline:
node() { def outputLog outputLog = sh(script: "ls -la /", returnStdout: true) println outputLog //prints full log outputLog.eachLine { line, count -> println "$count: $line" } //prints only 1 line outputlog = "ls -la /".execute().text outputlog.eachLine { println it } //prints all lines }
So workaround is to use that Groovy's execute.
[JENKINS-48308] Translate StringGroovyMethods.eachLine
Component/s | New: workflow-cps-plugin [ 21713 ] | |
Component/s | Original: durable-task-plugin [ 18622 ] | |
Summary | Original: Pipeline: Nodes and Processes: sh -step's output line changes are not working with groovy | New: Translate StringGroovyMethods.eachLine |