diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2015-09-10 14:51:10 +0200 |
---|---|---|
committer | Ryan Arnold <ryan.arnold@linaro.org> | 2015-09-11 14:02:00 +0000 |
commit | 18f5425ad06d54c886c36f3985066911d2bc5830 (patch) | |
tree | f67128df937653624c65498828ee237f0b359102 | |
parent | 5d257ef97cff1c3e771b1a6951d97245d862bbea (diff) |
jenkins.sh: Add set -e and set -o pipefail.
Special care is needed to continue if the build returned an error:
We still want to see the logs etc....
This patch helps catching errors earlier.
Change-Id: I1614385775ca7e0d57805666a2ce79f3f9101b77
-rwxr-xr-x | jenkins.sh | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -15,6 +15,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # +set -e +set -o pipefail # Improve debug logs PRGNAME=`basename $0` @@ -339,10 +341,11 @@ fi # Now we build the cross compiler, for a native compiler this becomes # the stage2 bootstrap build. -$CONFIG_SHELL ${abe_dir}/abe.sh --disable update ${check} ${tars} ${releasestr} ${platform} ${change} ${try_bootstrap} --timeout 100 --build all --disable make_docs > build.out 2> >(tee build.err >&2) +ret=0 +$CONFIG_SHELL ${abe_dir}/abe.sh --disable update ${check} ${tars} ${releasestr} ${platform} ${change} ${try_bootstrap} --timeout 100 --build all --disable make_docs > build.out 2> >(tee build.err >&2) || ret=$? # If abe returned an error, make jenkins see this as a build failure -if test $? -gt 0; then +if test $ret -gt 0; then echo "================= TAIL OF LOG: BEGIN =================" tail -n 50 build.out echo "================= TAIL OF LOG: FINISH =================" |