Hi again,
Jenkins run the above shebang by default:
-
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/tasks/Shell.java#L85
But if you run scripts and other scripts without trapping those errors
then IMO the root cause is basically in the scripts itself, so if those
scripts don't handle those errorlevels accordingly then you won't be able
to track those error, I'm afraid I don't know how electric commander works,
but jenkins does solve those error tracking accordingly and generally, but
for specific cases error tracking should be, IMO, managed by the scripts
rather than any tools, but this is another topic out of this thread.
Using shell scripts for building/testing/compiling are a kind of
non-standard way of doing automatic tasks, if you use
gradle/maven/ant/nant/.... then those errorlevels will be managed
accordingly. It's not a trivial change for old legacy systems, but that's
probably something else.
Let's see if someone else can provide another way of solving it.
Cheers
On Monday, 16 November 2015 10:21:46 UTC+1, Patricia Mendez Lorenzo wrote:
>
> Thanks a lot Victor for your answer.
>
> In any case, this is what we would like to avoid. At a certain point, when
> the chain of scripts is too long, we will certainly forget to include the
> -e option. This is not a robust approach. I was wondering in Jenkins is
> able to do it as toolkit, other tools are able to do it (as electric
> commander). You should not care about the error tracking; the tool should
> be able to do it for you
>
> Cheers
> Patricia
>
>
>
> El viernes, 13 de noviembre de 2015, 17:17:24 (UTC+1), Victor Martinez
> escribió:
>>
>> Hi,
>>
>> If I understood correctly you could add the below shebang in each script
>> file
>>
>> #!/bin/bash -xe
>>
>> Then in case of any errors of those children scripts will be trapped
>> accordingly. you might need to review whether you use any traps
>>
>>
>> I hope it helps
>>
>> Cheers
>>
>>
--
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/2441ecb6-91ef-48cd-af7c-079e05371f79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.