## Description 1. PR to enable server tests on PRs with `pg` as the base branch. 2. Replace the DB URI from `APPSMITH_MONGODB_URI` to `APPSMITH_DB_URL` ## Automation /ok-to-test tags="@tag.Sanity, @tag.GenerateCRUD, @tag.Fork" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9174148396> > Commit: 762b4255f654946a1a47a196df5a1afae5be09f2 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9174148396&attempt=1" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No --------- Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
58 lines
1.4 KiB
Bash
Executable File
58 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
set -o xtrace
|
|
|
|
ENV_PATH="/appsmith-stacks/configuration/docker.env"
|
|
SUPERVISORD_CONF_PATH="/opt/appsmith/templates/supervisord"
|
|
echo 'Load environment configuration'
|
|
set -o allexport
|
|
. "$ENV_PATH"
|
|
set +o allexport
|
|
|
|
check_mongodb_uri() {
|
|
echo "Check MongoDB uri host"
|
|
isLocalMongo=1
|
|
if [[ $APPSMITH_DB_URL == *"localhost"* || $APPSMITH_DB_URL == *"127.0.0.1"* ]]; then
|
|
echo "Use local MongoDB"
|
|
isLocalMongo=0
|
|
fi
|
|
}
|
|
check_redis_uri() {
|
|
echo "Check Redis uri host"
|
|
isLocalRedis=1
|
|
if [[ $APPSMITH_REDIS_URL == *"localhost"* || $APPSMITH_REDIS_URL == *"127.0.0.1"* ]]; then
|
|
echo "Use local Redis"
|
|
isLocalRedis=0
|
|
fi
|
|
}
|
|
|
|
update_supervisord_mongodb_conf() {
|
|
echo "Update supervisord MongoDB conf"
|
|
if [ $isLocalMongo -eq 1 ]; then
|
|
echo "Disable MongoDB supervisord"
|
|
rm -f mongodb.conf
|
|
else
|
|
echo "Enable MongoDB supervisord"
|
|
cp "$SUPERVISORD_CONF_PATH/mongodb.conf" /etc/supervisor/conf.d/
|
|
fi
|
|
}
|
|
|
|
update_supervisord_redis_conf() {
|
|
echo "Update supervisord Redis conf"
|
|
if [ $isLocalRedis -eq 1 ]; then
|
|
echo "Disable Redis supervisord"
|
|
rm -f redis.conf
|
|
else
|
|
echo "Enable Redis supervisord"
|
|
cp "$SUPERVISORD_CONF_PATH/redis.conf" /etc/supervisor/conf.d/
|
|
fi
|
|
}
|
|
|
|
check_mongodb_uri
|
|
update_supervisord_mongodb_conf
|
|
check_redis_uri
|
|
update_supervisord_redis_conf
|
|
supervisorctl restart backend editor rts
|
|
supervisorctl update
|