2020-04-14 10:45:36 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
|
2020-04-18 19:03:25 +00:00
|
|
|
function migrate() {
|
2020-04-14 10:45:36 -05:00
|
|
|
echo applying migrations - django_peeringdb
|
|
|
|
|
# always fake, since peeeringdb_server does not use concrete models
|
|
|
|
|
manage migrate django_peeringdb --fake
|
|
|
|
|
echo applying all migrations
|
|
|
|
|
manage migrate
|
2020-04-18 19:03:25 +00:00
|
|
|
}
|
2020-04-14 10:45:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
cd /srv/www.peeringdb.com
|
|
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
|
"uwsgi" )
|
|
|
|
|
echo starting uwsgi
|
2020-04-18 19:03:25 +00:00
|
|
|
if [[ "$PDB_NO_MIGRATE" == "" ]]; then
|
|
|
|
|
migrate
|
|
|
|
|
fi
|
2020-04-14 10:45:36 -05:00
|
|
|
exec venv/bin/uwsgi --ini etc/django-uwsgi.ini
|
|
|
|
|
;;
|
2020-04-18 19:03:25 +00:00
|
|
|
"migrate" )
|
|
|
|
|
migrate
|
|
|
|
|
;;
|
2020-04-14 10:45:36 -05:00
|
|
|
"inetd" )
|
|
|
|
|
inetd -f -e -q 1024
|
|
|
|
|
;;
|
|
|
|
|
"in.whois" )
|
|
|
|
|
exec ./in.whoisd
|
|
|
|
|
;;
|
2020-12-03 19:10:02 +00:00
|
|
|
"run_tests" )
|
|
|
|
|
source venv/bin/activate
|
|
|
|
|
export DJANGO_SETTINGS_MODULE=mainsite.settings
|
|
|
|
|
export DATABASE_USER=root
|
|
|
|
|
export DATABASE_PASSWORD=""
|
|
|
|
|
export RELEASE_ENV=run_tests
|
|
|
|
|
pytest -v -rA --cov-report term-missing --cov=peeringdb_server --durations=0 tests/
|
|
|
|
|
;;
|
2020-04-14 10:45:36 -05:00
|
|
|
"whois" )
|
|
|
|
|
line=$(head -1 | tr -cd '[:alnum:]._-')
|
|
|
|
|
exec manage pdb_whois "$line"
|
|
|
|
|
;;
|
|
|
|
|
"/bin/sh" )
|
|
|
|
|
echo dropping to shell
|
|
|
|
|
exec /bin/sh
|
|
|
|
|
;;
|
2020-05-27 18:09:53 -07:00
|
|
|
"makemessages" | "compilemessages" )
|
|
|
|
|
cd /mnt
|
|
|
|
|
exec django-admin $@
|
|
|
|
|
;;
|
2020-04-14 10:45:36 -05:00
|
|
|
* )
|
|
|
|
|
exec manage $@
|
|
|
|
|
;;
|
|
|
|
|
esac
|