Am 13.11.2017 um 13:40 schrieb M:
> I'm using two slaves, Windows and Linux. In the first case I have
> cywing so I execute commands in both slaves through sh:
>
> |
> ...
> node(label){
> sh '''#!/bin/bash -xei
>    whoami
>    echo $?
>    case $- in
>        *i*) echo This shell is interactive ;;
>        *)   echo This shell is not interactive ;;
>    esac
>    echo d = $?'''
> }
> ...
> |
>
>
> I put the $? in order to understand why, sometimes, after executing
> the build Jenkins returns an error (script returned exit code -1) even
> if all the exit values are 0s. It seems to be a random error. Most of
> the time the build is correct, but in some cases it returns this
> annoyng -1 exit value without a reason.

Which slave does it fail on, Linux or Windows? -1 sounds really strange
because most commands on Linux return positive numbers. Do you have the
console log of above script from a failing job? Since you're using "-x"
we ought to see which command is failing (and since you're also using
"-e", it should be the last one the script has executed).

Wonder why you're using "-i", though...

Bye...

    Dirk
-- 
*Dirk Heinrichs*
Senior Systems Engineer, Delivery Pipeline
OpenText^TM Discovery | Recommind
*Email*: [email protected] <mailto:[email protected]>
*Website*: www.recommind.de <http://www.recommind.de>

Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach

Vertretungsberechtigte Geschäftsführer John Marshall Doolittle, Gordon
Davies, Roger Illing, Registergericht Amtsgericht Bonn, Registernummer
HRB 10646

This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail sind nicht gestattet.

-- 
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/b9ce5e0d-81e3-3c30-e8ff-bd987f8448ed%40opentext.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to