Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix path handling in download-mongodb #498

Merged
merged 17 commits into from
Sep 17, 2024
21 changes: 3 additions & 18 deletions .evergreen/download-mongodb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -695,18 +695,14 @@ download_and_extract_package ()
MONGODB_DOWNLOAD_URL=$1
EXTRACT=$2

# shellcheck disable=SC3028
SCRIPT_DIR=$(dirname ${BASH_SOURCE:-$0})
. $SCRIPT_DIR/handle-paths.sh

if [ -n "${MONGODB_BINARIES:-}" ]; then
cd "$(dirname "$(dirname "${MONGODB_BINARIES:?}")")"
else
cd $DRIVERS_TOOLS
fi

echo "Installing server binaries..."
"$SCRIPT_DIR/retry-with-backoff.sh" curl $MONGODB_DOWNLOAD_URL --output mongodb-binaries.tgz
curl $MONGODB_DOWNLOAD_URL --output mongodb-binaries.tgz
Copy link
Contributor

@ShaneHarvey ShaneHarvey Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be using curl_retry here. curl_retry is defined in this file. Same for all the other curl calls.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you removed curl_retry in PYTHON-4734. How about we just revert that commit entirely (again)?


$EXTRACT mongodb-binaries.tgz
echo "Installing server binaries... done."
Expand All @@ -727,10 +723,6 @@ download_and_extract_mongosh ()
MONGOSH_DOWNLOAD_URL=$1
EXTRACT_MONGOSH=${2:-"tar zxf"}

# shellcheck disable=SC3028
SCRIPT_DIR=$(dirname ${BASH_SOURCE:-$0})
. $SCRIPT_DIR/handle-paths.sh

if [ -z "$MONGOSH_DOWNLOAD_URL" ]; then
get_mongodb_download_url_for "$(get_distro)" latest false
fi
Expand All @@ -742,7 +734,7 @@ download_and_extract_mongosh ()
fi

echo "Installing MongoDB shell..."
"$SCRIPT_DIR/retry-with-backoff.sh" curl $MONGOSH_DOWNLOAD_URL --output mongosh.tgz
curl $MONGOSH_DOWNLOAD_URL --output mongosh.tgz
$EXTRACT_MONGOSH mongosh.tgz

rm -f mongosh.tgz
Expand Down Expand Up @@ -771,10 +763,6 @@ download_and_extract ()
download_and_extract_mongosh "$MONGOSH_DOWNLOAD_URL" "$EXTRACT_MONGOSH"
fi

# shellcheck disable=SC3028
SCRIPT_DIR=$(dirname ${BASH_SOURCE:-$0})
. $SCRIPT_DIR/handle-paths.sh

if [ ! -z "${INSTALL_LEGACY_SHELL:-}" ] && [ ! -e $DRIVERS_TOOLS/mongodb/bin/mongo ] && [ ! -e $DRIVERS_TOOLS/mongodb/bin/mongo.exe ]; then
# The legacy mongo shell is not included in server downloads of 6.0.0-rc6 or later. Refer: SERVER-64352.
# Some test scripts use the mongo shell for setup.
Expand Down Expand Up @@ -829,10 +817,7 @@ download_and_extract_crypt_shared ()
mkdir crypt_shared_download
cd crypt_shared_download

# shellcheck disable=SC3028
SCRIPT_DIR=$(dirname ${BASH_SOURCE:-$0})
. $SCRIPT_DIR/handle-paths.sh
"$SCRIPT_DIR/retry-with-backoff.sh" curl $MONGO_CRYPT_SHARED_DOWNLOAD_URL --output crypt_shared-binaries.tgz
curl $MONGO_CRYPT_SHARED_DOWNLOAD_URL --output crypt_shared-binaries.tgz
$EXTRACT crypt_shared-binaries.tgz

LIBRARY_NAME="mongo_crypt_v1"
Expand Down
Loading