Skip to content
Snippets Groups Projects
Commit 6e5237f7 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

launcher: add support for mongosh

In newer MongoDB the mongo command was removed and replaced with
mongosh.
parent ab1d5294
No related branches found
No related tags found
No related merge requests found
Pipeline #452820 passed
...@@ -8,11 +8,18 @@ DIR="$( cd "$( dirname "$0" )" && pwd )" ...@@ -8,11 +8,18 @@ DIR="$( cd "$( dirname "$0" )" && pwd )"
MONGO_URI="mongodb://$MONGO_DB_USER:$MONGO_DB_PWD@$MONGO_HOST:$MONGO_PORT/$MONGO_DB_NAME?authSource=$MONGO_AUTH_SOURCE" MONGO_URI="mongodb://$MONGO_DB_USER:$MONGO_DB_PWD@$MONGO_HOST:$MONGO_PORT/$MONGO_DB_NAME?authSource=$MONGO_AUTH_SOURCE"
# In newer MongoDB the CLI was changed to mongosh (note that they are not fully compatible, so be carefull)
if command -v mongosh &> /dev/null; then
MONGO_CLI=mongosh
else
MONGO_CLI=mongo
fi
# Test if we can connect to the DB # Test if we can connect to the DB
mongo "$MONGO_URI" --eval "db" "$MONGO_CLI" "$MONGO_URI" --eval "db"
# Update the config # Update the config
mongo "$MONGO_URI" --eval "$(cat << EOF "$MONGO_CLI" "$MONGO_URI" --eval "$(cat << EOF
let config = [ let config = [
{ {
_id: "multiSeatLocationsUseSmallCheckinPages", _id: "multiSeatLocationsUseSmallCheckinPages",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment