Overlook the exit code as part of a shell or batch script

2013-09-17 Thread alok kumar
Hi All,
I have a requirement in which I am executing  some executable from the
shell or batch command build step.

Now, there is a known bug due to which the exit code of that shell or batch
command build step is non-zero, due, to which the build is getting
terminated as a failure.

I do not want this behaviour as we are aware of this issue and hence would
like to overlook it and go ahead with the next set of build steps.

Is there any way to accomplish this? If so, whats the best way to do it?

Thanks,
Alok

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Overlook the exit code as part of a shell or batch script

2013-09-17 Thread Andrew Melo
If you want to unconditionally return zero, do

set +e
command
exit 0

Cheers,
Andrew

On Tuesday, September 17, 2013, alok kumar wrote:

 Hi All,
 I have a requirement in which I am executing  some executable from the
 shell or batch command build step.

 Now, there is a known bug due to which the exit code of that shell or
 batch command build step is non-zero, due, to which the build is getting
 terminated as a failure.

 I do not want this behaviour as we are aware of this issue and hence would
 like to overlook it and go ahead with the next set of build steps.

 Is there any way to accomplish this? If so, whats the best way to do it?

 Thanks,
 Alok

 --
 You received this message because you are subscribed to the Google Groups
 Jenkins Developers group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to jenkinsci-dev+unsubscr...@googlegroups.com javascript:_e({},
 'cvml', 'jenkinsci-dev%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
--
Andrew Melo

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Overlook the exit code as part of a shell or batch script

2013-09-17 Thread JonathanRRogers

On Tuesday, September 17, 2013 9:47:13 AM UTC-4, alok kumar wrote:

 Hi All,
 I have a requirement in which I am executing  some executable from the 
 shell or batch command build step.

 Now, there is a known bug due to which the exit code of that shell or 
 batch command build step is non-zero, due, to which the build is getting 
 terminated as a failure.

 I do not want this behaviour as we are aware of this issue and hence would 
 like to overlook it and go ahead with the next set of build steps.

 Is there any way to accomplish this? If so, whats the best way to do it?


You can append  || true to a command in a shell script to always return a 
zero exit code. So, for example, if you have a command called failer 
which returns a non-zero exit code, you could use failer || true. This 
has the advantage of ignoring only the exit code from failer but still 
paying attention to other commands in the script.

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Overlook the exit code as part of a shell or batch script

2013-09-17 Thread alok kumar
Thanks all. I will try and let you know if it works for me.


On Tue, Sep 17, 2013 at 10:07 PM, JonathanRRogers jonathanrrog...@gmail.com
 wrote:


 On Tuesday, September 17, 2013 9:47:13 AM UTC-4, alok kumar wrote:

 Hi All,
 I have a requirement in which I am executing  some executable from the
 shell or batch command build step.

 Now, there is a known bug due to which the exit code of that shell or
 batch command build step is non-zero, due, to which the build is getting
 terminated as a failure.

 I do not want this behaviour as we are aware of this issue and hence
 would like to overlook it and go ahead with the next set of build steps.

 Is there any way to accomplish this? If so, whats the best way to do it?


 You can append  || true to a command in a shell script to always return
 a zero exit code. So, for example, if you have a command called failer
 which returns a non-zero exit code, you could use failer || true. This
 has the advantage of ignoring only the exit code from failer but still
 paying attention to other commands in the script.

 --
 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 jenkinsci-users+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.