diff --git a/build.sh b/build.sh index 2c038e3..3a4f992 100755 --- a/build.sh +++ b/build.sh @@ -163,6 +163,14 @@ if test $# -eq 0; then exit 1 fi +print_time () { + echo "Build took $SECONDS seconds" +} + +trap "echo \"Build failed\"; print_time" ERR + +SECONDS=0 + TRIGGER_BOOTLOADER=false TRIGGER_CONTROLLER=false TRIGGER_CIC=false @@ -213,3 +221,5 @@ if [ "$TRIGGER_CIC" = true ]; then build_cic; fi if [ "$TRIGGER_FPGA" = true ]; then build_fpga; fi if [ "$TRIGGER_UPDATE" = true ]; then build_update; fi if [ "$TRIGGER_RELEASE" = true ]; then build_release; fi + +print_time diff --git a/docker_build.sh b/docker_build.sh index 91663ad..d6f4831 100755 --- a/docker_build.sh +++ b/docker_build.sh @@ -14,8 +14,6 @@ if [ -t 1 ]; then DOCKER_OPTIONS="-it" fi -SECONDS=0 - docker run \ $DOCKER_OPTIONS \ --rm \ @@ -33,12 +31,8 @@ docker run \ $BUILDER_IMAGE \ ./build.sh $@ -BUILD_ERROR=$? - -echo "Build took $SECONDS seconds" +BUILD_RESULT=$? popd > /dev/null -if [ $BUILD_ERROR -ne 0 ]; then - exit -1 -fi +exit $BUILD_RESULT