In jenkins, you can run a script with sh()
. There is an options to returnStdout
, which will send stdout
to a return value, rather than printing it to the console.
Is it possible to capture stderr
in any way? Whether through an option to the function or through some workaround?
Generally, you can redirect a process's STDERR to STDOUT with 2>&1
and collect both.
There's no other way but this redirection workaround at the moment, see https://issues.jenkins-ci.org/browse/JENKINS-44930
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With