2016-01-12 13:08:43 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -xe
|
2013-11-13 05:38:54 +01:00
|
|
|
|
|
|
|
# Change to root directory of the checkout that we're running from
|
2015-09-26 03:47:30 +02:00
|
|
|
cd "$(dirname "$0")/../.."
|
2013-11-10 17:18:24 +01:00
|
|
|
|
2016-04-07 15:27:25 +02:00
|
|
|
python manage.py checkconfig
|
2013-11-13 05:38:54 +01:00
|
|
|
|
2016-04-07 15:27:25 +02:00
|
|
|
python manage.py migrate --noinput
|
|
|
|
python manage.py createcachetable third_party_api_results
|
2015-09-30 03:24:46 +02:00
|
|
|
|
2016-04-07 15:27:25 +02:00
|
|
|
if ! python manage.py initialize_voyager_db; then
|
2015-09-30 03:24:46 +02:00
|
|
|
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
|
2015-10-15 05:07:17 +02:00
|
|
|
exit 1
|
2015-09-30 03:24:46 +02:00
|
|
|
fi
|
2013-11-13 05:38:54 +01:00
|
|
|
|
|
|
|
supervisorctl restart all
|
2015-09-30 07:23:25 +02:00
|
|
|
|
2015-12-20 14:59:21 +01:00
|
|
|
set +x
|
2015-09-30 07:23:25 +02:00
|
|
|
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 ""
|
2016-07-12 22:02:30 +02:00
|
|
|
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."
|
2015-12-20 14:59:21 +01:00
|
|
|
set -x
|