Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
fix: mongosh in provision.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVZ96 committed Feb 17, 2024
1 parent 29b08cd commit 84a59d5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,22 @@ if needs_mongo "$to_provision_ordered"; then
echo -e "${GREEN}Waiting for MongoDB...${NC}"
# mongo container and mongo process/shell inside the container
MONGO_SHELL=$(docker-compose exec -T mongo which mongosh)
if [[ $MONGO_SHELL ]] then
if [ -z "$MONGO_SHELL" ]; then
until docker-compose exec -T mongo mongosh --eval "db.serverStatus()" &> /dev/null
do
printf "."
sleep 1
done
else
until docker-compose exec -T mongo mongo --eval "db.serverStatus()" &> /dev/null
do
printf "."
sleep 1
done
fi
t do
printf "."
sleep 1
done
echo -e "${GREEN}MongoDB ready.${NC}"
echo -e "${GREEN}Creating MongoDB users...${NC}"
if [[ $MONGO_SHELL ]] then
if [ -z $MONGO_SHELL ] then
docker-compose exec -T mongo bash -e -c "mongosh" < mongo-provision.js
else
docker-compose exec -T mongo bash -e -c "mongo" < mongo-provision.js
Expand Down

0 comments on commit 84a59d5

Please sign in to comment.