diff --git a/dev/ci-before_install.sh b/dev/ci-before_install.sh index 6b57624a23..2cfaee56a3 100755 --- a/dev/ci-before_install.sh +++ b/dev/ci-before_install.sh @@ -23,14 +23,24 @@ export THRIFT_VERSION=0.22.0 set -e +set -o pipefail date sudo apt-get update -qq sudo apt-get install -qq --no-install-recommends build-essential pv autoconf automake libtool curl make \ - g++ unzip libboost-dev libboost-test-dev libboost-program-options-dev \ + g++ unzip libboost-dev libboost-test-dev libboost-program-options-dev wget \ libevent-dev automake libtool flex bison pkg-config g++ libssl-dev xmlstarlet date pwd -wget -qO- https://archive.apache.org/dist/thrift/$THRIFT_VERSION/thrift-$THRIFT_VERSION.tar.gz | tar zxf - +for attempt in 1 2 3; do + if wget -nv -O- https://archive.apache.org/dist/thrift/$THRIFT_VERSION/thrift-$THRIFT_VERSION.tar.gz | tar zxf -; then + break + fi + if [[ "$attempt" -eq 3 ]]; then + echo "Failed to download thrift after ${attempt} attempts." >&2 + exit 1 + fi + sleep $((attempt * 5)) +done cd thrift-${THRIFT_VERSION} chmod +x ./configure ./configure --disable-libs