Skip to content

Commit 49cc433

Browse files
committed
download legacy shell from 6.0 download
1 parent f3729ea commit 49cc433

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.evergreen/download-mongodb.sh

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,8 @@ get_mongodb_download_url_for ()
488488
echo $MONGODB_DOWNLOAD_URL
489489
}
490490

491-
download_and_extract ()
491+
# download_and_extract_package downloads a MongoDB server package.
492+
download_and_extract_package ()
492493
{
493494
MONGODB_DOWNLOAD_URL=$1
494495
EXTRACT=$2
@@ -504,3 +505,30 @@ download_and_extract ()
504505
./mongodb/bin/mongod --version
505506
cd -
506507
}
508+
509+
# download_and_extract downloads a requested MongoDB server package.
510+
# If the legacy shell is not included in the download, the legacy shell is also downloaded from the 6.0 package.
511+
download_and_extract ()
512+
{
513+
MONGODB_DOWNLOAD_URL=$1
514+
EXTRACT=$2
515+
516+
download_and_extract_package "$MONGODB_DOWNLOAD_URL" "$EXTRACT"
517+
518+
if [ ! -e $DRIVERS_TOOLS/mongodb/bin/mongo ]; then
519+
# The legacy mongo shell is not included in server downloads of 6.0.0-rc6 or later. Refer: SERVER-64352.
520+
# Some test scripts use the mongo shell for setup.
521+
# Download 6.0 package to get the legacy mongo shell as a workaround until DRIVERS-???? is addressed.
522+
echo "Legacy 'mongo' shell not detected. Download from 6.0 ... begin"
523+
get_mongodb_download_url_for "$DISTRO" "6.0"
524+
525+
SAVED_DRIVERS_TOOLS=$DRIVERS_TOOLS
526+
mkdir $DRIVERS_TOOLS/legacy-shell-download
527+
DRIVERS_TOOLS=$DRIVERS_TOOLS/legacy-shell-download
528+
download_and_extract_package "$MONGODB_DOWNLOAD_URL" "$EXTRACT"
529+
cp $DRIVERS_TOOLS/mongodb/bin/mongo $SAVED_DRIVERS_TOOLS/mongodb/bin
530+
DRIVERS_TOOLS=$SAVED_DRIVERS_TOOLS
531+
rm -rf $DRIVERS_TOOLS/legacy-shell-download
532+
echo "Legacy 'mongo' shell not detected. Download from 6.0 ... end"
533+
fi
534+
}

0 commit comments

Comments
 (0)