aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harkin <ryan.harkin@linaro.org>2016-12-14 07:57:28 +0000
committerRyan Harkin <ryan.harkin@linaro.org>2016-12-14 07:57:28 +0000
commitd88a6cef5db88aceec027a1984065df6c73385d3 (patch)
tree6d324d89932715390190cd29549720c7e05ca202
parent2fda1f8a3d32b3a41fbff3d4af8d394704540969 (diff)
Trap apt-get errors and abort build
Jenkins was failing to install some apt-get dependencies, so trap the failures and abort the build when this happens. Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
-rwxr-xr-xplatforms-ci.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/platforms-ci.sh b/platforms-ci.sh
index 0961072..fa2815c 100755
--- a/platforms-ci.sh
+++ b/platforms-ci.sh
@@ -4,6 +4,13 @@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${SCRIPT_DIR}/platforms-common.sh
+function trap_apt_failure
+{
+ echo "ERROR: failed to install mandatory package"
+ echo "ERROR: aborting the build"
+ exit 1
+}
+
job_output_dir=out
PARALLELISM=`getconf _NPROCESSORS_ONLN`
@@ -41,6 +48,9 @@ echo "platforms-ci.sh: doing a $PINNED $JOB_TYPE build for branch $YYMM"
# pre-requisites
if [ "$JOB_NAME" != "" ]; then
+
+ trap trap_apt_failure ERR
+
sudo apt-get update
sudo apt-get install -y --force-yes bison
@@ -55,6 +65,8 @@ if [ "$JOB_NAME" != "" ]; then
# Additional dependencies needed for this CI script
sudo apt-get install -y --force-yes zip
+ trap ERR
+
if [ "$USE_PRE_INSTALLED_TOOLCHAIN" == "yes" ]; then
# Toolchain
echo ls ${HOME}/srv/toolchain/