Yes you’re right and it avoids if loop. 

 

Thank

 

De : [email protected]
[mailto:[email protected]] De la part de JonathanRRogers
Envoyé : mercredi 24 juillet 2013 18:55
À : [email protected]
Cc : [email protected]
Objet : Re: Avoid script shell build failure

 

On Wednesday, July 24, 2013 12:53:09 PM UTC-4, JonathanRRogers wrote:

On Wednesday, July 24, 2013 5:49:46 AM UTC-4, Dirk Heinrichs wrote:

Am Mittwoch, 24. Juli 2013, 11:25:10 schrieb Adrien Ruffié: 

> Do you have an idea, how I can avoid this failure and continu other build 
> step and enter into else statement ? 

It's because the script is started with -xe. -e lets the script fail as soon

as any command exits with non-zero return code. Try adding "set +e" at the
top 
of your script. 


I think a better way is to leave the -e as is and deal just with the
commands which could fail. For example, the above script might have the git
commit line rewritten to allow it to fail without ending the entire script:
git commit --verbose -F webapp/res/description.xml && true


Sorry, I wasn't thinking clearly for a second. The command should be:
 git commit --verbose -F webapp/res/description.xml || true

-- 
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  <mailto:[email protected]>
[email protected].
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to