**/test sanity** <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Updated logging mechanism from `echo` to `tlog` for improved log management across various scripts. - **Chores** - Enhanced logging for better clarity and consistency in deployment scripts. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
32 lines
618 B
Bash
32 lines
618 B
Bash
#!/bin/bash
|
|
|
|
set -o errexit
|
|
set -o nounset
|
|
|
|
{
|
|
|
|
while [[ ! -S "$TMP/supervisor.sock" ]]; do
|
|
sleep 1
|
|
done
|
|
tlog "supervisor.sock found"
|
|
|
|
while supervisorctl status mongodb | grep -q RUNNING; do
|
|
sleep 1
|
|
done
|
|
tlog "MongoDB is RUNNING"
|
|
|
|
for _ in {1..60}; do
|
|
if mongosh --quiet "$APPSMITH_DB_URL" --eval '
|
|
parseFloat(db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1}).featureCompatibilityVersion.version) < 5 &&
|
|
db.adminCommand({setFeatureCompatibilityVersion: "5.0"})
|
|
'; then
|
|
tlog "MongoDB version set to 5.0"
|
|
break
|
|
fi
|
|
sleep 1
|
|
done
|
|
|
|
tlog Done
|
|
|
|
} | sed -u 's/^/mongodb-fixer: /'
|