Skip to content

Commit

Permalink
optimize wait mongo ready prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
bxy4543 committed Oct 11, 2023
1 parent 85414c8 commit 6d4985e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion deploy/cloud/scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,19 @@ function gen_mongodbUri() {
echo "no mongodb uri found, create mongodb and gen mongodb uri"
kubectl apply -f manifests/mongodb.yaml
echo "waiting for mongodb secret generated"
message="Waiting for MongoDB ready"
# if there is no sealos-mongodb-conn-credential secret then wait for mongodb ready
while [ -z "$(kubectl get secret -n sealos sealos-mongodb-conn-credential 2>/dev/null)" ]; do
sleep 3
echo -ne "\r$message \e[K"
sleep 0.5
echo -ne "\r$message . \e[K"
sleep 0.5
echo -ne "\r$message .. \e[K"
sleep 0.5
echo -ne "\r$message ...\e[K"
sleep 0.5
done
echo "mongodb secret has been generated successfully."
chmod +x scripts/gen-mongodb-uri.sh
mongodbUri=$(scripts/gen-mongodb-uri.sh)
fi
Expand Down

0 comments on commit 6d4985e

Please sign in to comment.