Thank you for your reply. The random error appears only in the Windows
slave which uses Cygwin. In the console log I only see this when it works
correctly:
test #20 completed: SUCCESS
and when it fails:
test #25 completed: FAILURE
The -i is my mistake :)
Il giorno lunedì 13 novembre 2017 14:32:45 UTC+1, Dirk Heinrichs ha scritto:
>
> 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
> OpenTextTM Discovery | Recommind
> *Email*: [email protected] <javascript:>
> *Website*: 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/a18b716f-22f5-4369-8fe8-2c3d9eb79db9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.