root: automate system migrations, move docker to lifecycle folder

This commit is contained in:
Jens Langhammer
2020-09-10 00:14:59 +02:00
parent 1356a8108b
commit 430905295d
16 changed files with 158 additions and 48 deletions

14
lifecycle/bootstrap.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash -e
python -m lifecycle.wait_for_db
printf '{"event": "Bootstrap completed", "level": "info", "logger": "bootstrap", "command": "%s"}\n' "$@"
if [[ "$1" == "server" ]]; then
gunicorn -c /lifecycle/gunicorn.conf.py passbook.root.asgi:application
elif [[ "$1" == "worker" ]]; then
celery worker --autoscale=10,3 -E -B -A=passbook.root.celery -s=/tmp/celerybeat-schedule
elif [[ "$1" == "migrate" ]]; then
# Run system migrations first, run normal migrations after
python -m lifecycle.migrate
python -m manage migrate
else
python -m manage "$@"
fi