#!/bin/bash

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
sudo sh $CASSANDRA_BASE/bin/cassandra

#!/bin/bash

CASSANDRA_BASE=apache-cassandra-$CASSANDRA_VERSION

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

Update CI script cassandra to retry download if it fails
Update CI script cassandra to retry download if it fails