install: Script the install process more fully.

We can probably later merge the create-database code with that of our
internal do-destroy-rebuild-database.

(imported from commit 323932dbf2eb916545d6ebdda70eb1f5e1abb181)
This commit is contained in:
Tim Abbott 2013-11-10 11:18:24 -05:00
parent 2e41515cc3
commit 57b5231063
2 changed files with 16 additions and 3 deletions

11
scripts/setup/create-database Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh -xe
ln -s /var/cache/postgresql/dicts/en_us.dict /usr/share/postgresql/9.1/tsearch_data/en_us.dict
ln -s /var/cache/postgresql/dicts/en_us.affix /usr/share/postgresql/9.1/tsearch_data/en_us.affix
echo "DROP SCHEMA zulip CASCADE; CREATE SCHEMA zulip;" | python manage.py dbshell
python manage.py syncdb --noinput
python manage.py migrate
python manage.py createcachetable third_party_api_results
python manage.py initialize_local_server_db

View File

@ -38,17 +38,19 @@ ln -nsf /etc/zulip/settings.py /root/zulip/zproject/local_settings.py
/root/zulip/scripts/setup/configure-rabbitmq
chown zulip:zulip /var/run/supervisor.sock
/root/zulip/scripts/setup/postgres-init-db
/root/zulip/scripts/setup/create-database
deploy_path=$($(dirname $(dirname $0))/unpack-zulip "$tarball")
ln -nsf "$deploy_path" /home/zulip/deployments/current
chown -R zulip:zulip /home/zulip/deployments
chown zulip:zulip /var/run/supervisor.sock
supervisorctl restart all
set +x
cat <<EOF
Done.
Now do the next step!
EOF