From 514aee0d7dda3864800030e382a9e919578ccd78 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Sun, 6 Dec 2015 22:01:35 +0100 Subject: [PATCH] Update CI script cassandra to retry download if it fails --- .ci/setup_cassandra.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.ci/setup_cassandra.sh b/.ci/setup_cassandra.sh index de57890592a6..6b81db4003b1 100644 --- a/.ci/setup_cassandra.sh +++ b/.ci/setup_cassandra.sh @@ -2,6 +2,18 @@ CASSANDRA_BASE=apache-cassandra-$CASSANDRA_VERSION -sudo rm -rf /var/lib/cassandra/* -curl http://apache.arvixe.com/cassandra/$CASSANDRA_VERSION/$CASSANDRA_BASE-bin.tar.gz | tar xz +n=0 +until [ $n -ge 5 ] +do + sudo rm -rf /var/lib/cassandra/* + curl http://apache.arvixe.com/cassandra/$CASSANDRA_VERSION/$CASSANDRA_BASE-bin.tar.gz | tar xz && break + n=$[$n+1] + sleep 5 +done + +if [[ ! -f $CASSANDRA_BASE/bin/cassandra ]] ; then + echo 'Failed downloading and unpacking cassandra. Aborting.' + exit 1 +fi + sudo sh $CASSANDRA_BASE/bin/cassandra