mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-25 22:22:26 +00:00
29 lines
888 B
Bash
29 lines
888 B
Bash
|
#!/usr/bin/env bash
|
||
|
set -euo pipefail
|
||
|
|
||
|
cp -n cotisations/templates/cotisations/invoice.html templates/default_invoice.html
|
||
|
cp -n cotisations/templates/cotisations/voucher.html templates/default_voucher.html
|
||
|
|
||
|
AUTOMIGRATE=${AUTOMIGRATE:-yes}
|
||
|
|
||
|
if [ "$AUTOMIGRATE" != "skip" ]; then
|
||
|
poetry run python manage.py migrate --noinput
|
||
|
fi
|
||
|
|
||
|
poetry run python manage.py collectstatic -c --noinput
|
||
|
poetry run python manage.py compilemessages
|
||
|
|
||
|
cat <<EOF | poetry run python manage.py shell
|
||
|
from django.contrib.auth import get_user_model
|
||
|
|
||
|
User = get_user_model()
|
||
|
|
||
|
User.objects.filter(pseudo='$SUPERUSER_LOGIN').exists() or \
|
||
|
User.objects.create_superuser(pseudo='$SUPERUSER_LOGIN', email='$SUPERUSER_EMAIL', password='$SUPERUSER_PASS', surname='$SUPERUSER_LOGIN')
|
||
|
EOF
|
||
|
|
||
|
if [ "$RUN_TESTS" != "no" ]; then
|
||
|
poetry run python manage.py test
|
||
|
else
|
||
|
poetry run python manage.py runserver 0.0.0.0:8000
|
||
|
fi
|