-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: workflow-cps-plugin
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.