diff --git a/Projects/AthSimulation/build_externals.sh b/Projects/AthSimulation/build_externals.sh index 1548b155d9b1d5163c8713a0914ef352f586a57a..63b9fee3d296e73088828e9747b6f5d14e078ec6 100755 --- a/Projects/AthSimulation/build_externals.sh +++ b/Projects/AthSimulation/build_externals.sh @@ -57,9 +57,12 @@ while getopts ":t:b:x:fch" opt; do esac done -# Stop on errors from here on out: -set -e -set -o pipefail +# Only stop on errors if we are in the CI. Otherwise just count them. +if [ "$CI" = "1" ]; then + set -e + set -o pipefail +fi +ERROR_COUNT=0 # We are in BASH, get the path of this script in a simple way: thisdir=$(dirname ${BASH_SOURCE[0]}) @@ -118,7 +121,7 @@ ${scriptsdir}/build_atlasexternals.sh \ -b ${BUILDDIR}/build/AthSimulationExternals \ -i ${BUILDDIR}/install/AthSimulationExternals/${NICOS_PROJECT_VERSION} \ -p AthSimulationExternals ${RPMOPTIONS} -t ${BUILDTYPE} \ - ${EXTRACMAKE[@]/#/-x } -v ${NICOS_PROJECT_VERSION} + ${EXTRACMAKE[@]/#/-x } -v ${NICOS_PROJECT_VERSION} || ((ERROR_COUNT++)) # Get the "platform name" from the directory created by the AthSimulationExternals # build: @@ -140,4 +143,10 @@ ${scriptsdir}/build_Gaudi.sh \ -i ${BUILDDIR}/install/GAUDI/${NICOS_PROJECT_VERSION} \ -e ${BUILDDIR}/install/AthSimulationExternals/${NICOS_PROJECT_VERSION}/InstallArea/${platform} \ -p AthSimulationExternals -f ${platform} ${EXTRACMAKE[@]/#/-x } \ - ${RPMOPTIONS} -t ${BUILDTYPE} + ${RPMOPTIONS} -t ${BUILDTYPE} || ((ERROR_COUNT++)) + +# Exit with the error count taken into account. +if [ ${ERROR_COUNT} -ne 0 ]; then + echo "AthSimulation externals build encountered ${ERROR_COUNT} error(s)" +fi +exit ${ERROR_COUNT} diff --git a/Projects/Athena/build_externals.sh b/Projects/Athena/build_externals.sh index 01404b17391bb4b9c097403309b7e1603bbc27bc..38ff7afb4344ebf1e3b3e37f08c14c9d74b6b83f 100755 --- a/Projects/Athena/build_externals.sh +++ b/Projects/Athena/build_externals.sh @@ -57,9 +57,12 @@ while getopts ":t:b:x:fch" opt; do esac done -# Stop on errors from here on out -set -e -set -o pipefail +# Only stop on errors if we are in the CI. Otherwise just count them. +if [ "$CI" = "1" ]; then + set -e + set -o pipefail +fi +ERROR_COUNT=0 # We are in BASH, get the path of this script in a simple way: thisdir=$(dirname ${BASH_SOURCE[0]}) @@ -143,7 +146,7 @@ ${scriptsdir}/build_atlasexternals.sh \ -i ${BUILDDIR}/install/AthenaExternals/${NICOS_PROJECT_VERSION} \ -p AthenaExternals ${RPMOPTIONS} -t ${BUILDTYPE} \ -v ${NICOS_PROJECT_VERSION} \ - ${EXTRACMAKE[@]/#/-x } + ${EXTRACMAKE[@]/#/-x } || ((ERROR_COUNT++)) { test "X${NIGHTLY_STATUS}" != "X" && { @@ -182,7 +185,7 @@ ${scriptsdir}/build_Gaudi.sh \ -i ${BUILDDIR}/install/GAUDI/${NICOS_PROJECT_VERSION} \ -e ${BUILDDIR}/install/AthenaExternals/${NICOS_PROJECT_VERSION}/InstallArea/${platform} \ -p AthenaExternals -f ${platform} ${RPMOPTIONS} -t ${BUILDTYPE} \ - ${EXTRACMAKE[@]/#/-x } + ${EXTRACMAKE[@]/#/-x } || ((ERROR_COUNT++)) { test "X${NIGHTLY_STATUS}" != "X" && { @@ -192,3 +195,9 @@ ${scriptsdir}/build_Gaudi.sh \ ) } || true } + +# Exit with the error count taken into account. +if [ ${ERROR_COUNT} -ne 0 ]; then + echo "Athena externals build encountered ${ERROR_COUNT} error(s)" +fi +exit ${ERROR_COUNT}