This repository has been archived by the owner on Aug 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: mongosh for mongo >=6.0 provision.sh support
- Loading branch information
1 parent
1fd52d1
commit c7b0715
Showing
5 changed files
with
73 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
set -eu -o pipefail | ||
|
||
# This script will upgrade a devstack that was previosly running Mongo DB 5.x to MongoDB 6.x | ||
|
||
. scripts/colors.sh | ||
|
||
# Upgrade to mongo 6.0 | ||
export MONGO_VERSION=6.0.12 | ||
|
||
echo | ||
echo -e "${GREEN}Restarting Mongo on version ${MONGO_VERSION}${NC}" | ||
make dev.up.mongo | ||
mongo_container="$(make --silent --no-print-directory dev.print-container.mongo)" | ||
|
||
echo -e "${GREEN}Waiting for MongoDB...${NC}" | ||
until docker exec "$mongo_container" mongosh --eval 'db.serverStatus()' &> /dev/null | ||
do | ||
printf "." | ||
sleep 1 | ||
done | ||
|
||
echo -e "${GREEN}MongoDB ready.${NC}" | ||
MONGO_VERSION_LIVE=$(docker exec -it "$mongo_container" mongosh --quiet --eval "printjson(db.version())") | ||
MONGO_VERSION_COMPAT=$(docker exec -it "$mongo_container" mongosh --quiet \ | ||
--eval "printjson(db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )['featureCompatibilityVersion'])") | ||
echo -e "${GREEN}Mongo Server version: ${MONGO_VERSION_LIVE}${NC}" | ||
echo -e "${GREEN}Mongo FeatureCompatibilityVersion version: ${MONGO_VERSION_COMPAT}${NC}" | ||
|
||
echo -e "${GREEN}Upgrading FeatureCompatibilityVersion to 6.0${NC}" | ||
docker exec -it "$mongo_container" mongosh --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"6.0\" } )" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
set -eu -o pipefail | ||
|
||
# This script will upgrade a devstack that was previosly running Mongo DB 6.x to MongoDB 7.x | ||
|
||
. scripts/colors.sh | ||
|
||
# Upgrade to mongo 7.0 | ||
export MONGO_VERSION=7.0.5 | ||
|
||
echo | ||
echo -e "${GREEN}Restarting Mongo on version ${MONGO_VERSION}${NC}" | ||
make dev.up.mongo | ||
mongo_container="$(make --silent --no-print-directory dev.print-container.mongo)" | ||
|
||
echo -e "${GREEN}Waiting for MongoDB...${NC}" | ||
until docker exec "$mongo_container" mongosh --eval 'db.serverStatus()' &> /dev/null | ||
do | ||
printf "." | ||
sleep 1 | ||
done | ||
|
||
echo -e "${GREEN}MongoDB ready.${NC}" | ||
MONGO_VERSION_LIVE=$(docker exec -it "$mongo_container" mongosh --quiet --eval "printjson(db.version())") | ||
MONGO_VERSION_COMPAT=$(docker exec -it "$mongo_container" mongosh --quiet \ | ||
--eval "printjson(db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )['featureCompatibilityVersion'])") | ||
echo -e "${GREEN}Mongo Server version: ${MONGO_VERSION_LIVE}${NC}" | ||
echo -e "${GREEN}Mongo FeatureCompatibilityVersion version: ${MONGO_VERSION_COMPAT}${NC}" | ||
|
||
echo -e "${GREEN}Upgrading FeatureCompatibilityVersion to 7.0${NC}" | ||
docker exec -it "$mongo_container" mongosh --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"7.0\" } )" |