Not sure I understand that workaround.
(((("$@" 2>&1; echo $? >&3) | tee "$LOGFILE" >&4) 3>&1) | (read xs; exit $xs))
4>&1
I tried to modify this to work with my example:
final def output = sh(returnStdout: true, script: "((((make >&3) | tee
buildOutput.txt >&4) 3>&1) | (read xs; exit $xs)) 4>&1")
Not quite sure how!
mandag 27. mai 2019 12.57.28 UTC+2 skrev Ullrich Hafner følgende:
>
> Would a workaround as shown in
> https://issues.jenkins-ci.org/browse/JENKINS-54832 help?
>
> Am 27.05.2019 um 12:51 schrieb Sverre Moe <[email protected] <javascript:>
> >:
>
> I found a way to ouput both stdout and stderr, but then I didn't get
> either in Jenkins Console.
> sh("make 2>&1 | tee buildOutputFile.txt")
>
> mandag 27. mai 2019 12.20.17 UTC+2 skrev Sverre Moe følgende:
>>
>> The standard output from the sh-step does not show all the output:
>> final def output = sh(returnStdout: true, label: "Build and Package",
>> script: "make")
>> writeFile(file: 'buildOutputFile.txt', text: output)
>>
>> The Blue Ocean log output from a single Node shows all the warnings, but
>> the output from the sh step does not:
>>
>> https://JENKINS_URL/blue/rest/organizations/jenkins/pipelines/PROJECT/branches/BRANCH/runs/2/nodes/56/log/?start=0
>>
>> <https://jenkins_url/blue/rest/organizations/jenkins/pipelines/PROJECT/branches/BRANCH/runs/2/nodes/56/log/?start=0>
>>
>> Could it be that the actual output is not stdout, but stderr?
>> Unfortunately sh does not have an returnStderr.
>>
>> I am using this output for the Warnings Plugin, since I want warning for
>> each build node, and the plugin default reads the entire console output.
>> recordIssues(tools: [gcc4(id: "gcc-${buildHost}", name: "${buildHost}",
>> pattern: "buildOutputFile.txt")])
>>
>
> --
> 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 [email protected] <javascript:>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/5efbb0ab-54e9-462c-86f6-2ff0593a88fa%40googlegroups.com
>
> <https://groups.google.com/d/msgid/jenkinsci-users/5efbb0ab-54e9-462c-86f6-2ff0593a88fa%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/17a84031-c584-4a8b-a5a5-309d21b0e46e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.