REST API - uses STDERR for transfer information

I am using a Command Line Runner build step to tag to the build.
Unfortunately, however, the transfer of information is seemingly written to STDERR.

I can achieve with "2 >> & 1" (on Windows) a redirection of STDERR, but then the actual error in the build log are not shown as "important messages". But this is e.g. helpful if the password is incorrect.

Example of transfer information:
[10:23:51]  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[10:23:51]                                 Dload  Upload   Total   Spent    Left  Speed
[10:23:51]  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
[10:23:51]100    10    0     5  100     5     16     16 --:--:-- --:--:-- --:--:--    16

Any reference to the behavior better to resolve?

1 comment
Comment actions Permalink

Hi,

You can add -s (silent mode) to curl command and put command's output to STDERR (Linux example):

out=`curl -s -u user:password --request POST http://localhost:8111/httpAuth/app/rest/builds/id:%build.counter%/tags/ --data tag --header "Content-Type: text/plain"`
>&2 echo $out

0

Please sign in to leave a comment.