Skip to content

Commit 6e4a249

Browse files
authored
Minor: ci-before_install.sh should show wget errors and retry (#3381)
* [minor] ci-before_install.sh should show wget errors * update wget * Try non-gnu flag * add sleep & retries
1 parent 6abb257 commit 6e4a249

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

dev/ci-before_install.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,24 @@
2323
export THRIFT_VERSION=0.22.0
2424

2525
set -e
26+
set -o pipefail
2627
date
2728
sudo apt-get update -qq
2829
sudo apt-get install -qq --no-install-recommends build-essential pv autoconf automake libtool curl make \
29-
g++ unzip libboost-dev libboost-test-dev libboost-program-options-dev \
30+
g++ unzip libboost-dev libboost-test-dev libboost-program-options-dev wget \
3031
libevent-dev automake libtool flex bison pkg-config g++ libssl-dev xmlstarlet
3132
date
3233
pwd
33-
wget -qO- https://archive.apache.org/dist/thrift/$THRIFT_VERSION/thrift-$THRIFT_VERSION.tar.gz | tar zxf -
34+
for attempt in 1 2 3; do
35+
if wget -nv -O- https://archive.apache.org/dist/thrift/$THRIFT_VERSION/thrift-$THRIFT_VERSION.tar.gz | tar zxf -; then
36+
break
37+
fi
38+
if [[ "$attempt" -eq 3 ]]; then
39+
echo "Failed to download thrift after ${attempt} attempts." >&2
40+
exit 1
41+
fi
42+
sleep $((attempt * 5))
43+
done
3444
cd thrift-${THRIFT_VERSION}
3545
chmod +x ./configure
3646
./configure --disable-libs

0 commit comments

Comments
 (0)