Skip to content

Commit

Permalink
Update CI script cassandra to retry download if it fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske committed Dec 6, 2015
1 parent bdc6043 commit 514aee0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .ci/setup_cassandra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 514aee0

Please sign in to comment.