Skip to content

Commit

Permalink
update to use curl_retry
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Sep 17, 2024
1 parent ea98675 commit e2eeaad
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .evergreen/download-mongodb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,12 @@ set_url_win32 ()
MONGODB_24="https://fastdl.mongodb.org/win32/mongodb-win32-i386${DEBUG}-${VERSION_24}.zip"
}

# curl_retry runs curl with up to three retries, retrying any error.
curl_retry ()
{
for i in 2 4 8; do curl --fail -sS --max-time 300 "$@" && break || sleep $i;
done
}

# download_and_extract_package downloads a MongoDB server package.
download_and_extract_package ()
Expand All @@ -702,7 +708,7 @@ download_and_extract_package ()
fi

echo "Installing server binaries..."
curl $MONGODB_DOWNLOAD_URL --output mongodb-binaries.tgz
curl_retry $MONGODB_DOWNLOAD_URL --output mongodb-binaries.tgz

$EXTRACT mongodb-binaries.tgz
echo "Installing server binaries... done."
Expand Down Expand Up @@ -734,7 +740,7 @@ download_and_extract_mongosh ()
fi

echo "Installing MongoDB shell..."
curl $MONGOSH_DOWNLOAD_URL --output mongosh.tgz
curl_retry $MONGOSH_DOWNLOAD_URL --output mongosh.tgz
$EXTRACT_MONGOSH mongosh.tgz

rm -f mongosh.tgz
Expand Down Expand Up @@ -817,7 +823,7 @@ download_and_extract_crypt_shared ()
mkdir crypt_shared_download
cd crypt_shared_download

curl $MONGO_CRYPT_SHARED_DOWNLOAD_URL --output crypt_shared-binaries.tgz
curl_retry $MONGO_CRYPT_SHARED_DOWNLOAD_URL --output crypt_shared-binaries.tgz
$EXTRACT crypt_shared-binaries.tgz

LIBRARY_NAME="mongo_crypt_v1"
Expand Down

0 comments on commit e2eeaad

Please sign in to comment.