#!/usr/bin/env bash set -xe # Change to root directory of the checkout that we're running from cd "$(dirname "$0")/../.." python manage.py checkconfig python manage.py migrate --noinput python manage.py createcachetable third_party_api_results if ! python manage.py initialize_voyager_db; then set +x echo echo -e "\033[32mPopulating default database failed." echo "After you fix the problem, you will need to do the following before rerunning this:" echo " * supervisorctl stop all # to stop all services that might be accessing the database" echo " * scripts/setup/postgres-init-db # run as root to drop and re-create the database" echo -e "\033[0m" set -x exit 1 fi supervisorctl restart all set +x echo "Congratulations! You have successfully configured your Zulip database." echo "If you haven't already, you should configure email in /etc/zulip/settings.py" echo "And then you should now be able to visit your server over https and sign up using" echo "an email address that ends with @ADMIN_DOMAIN (from your settings file)." echo "" echo "See docs/prod-health-check-debug.md for instructions on how to confirm your Zulip " echo "install is healthy, change ADMIN_DOMAIN, debug common issues, and otherwise finish " echo "setting things up." set -x