mirror of https://gitlab.federez.net/re2o/re2o
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
783 B
23 lines
783 B
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cat docker/settings_local.template.py | envsubst > re2o/settings_local.py
|
|
|
|
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
|
|
|
|
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
|
|
poetry run python manage.py runserver 0.0.0.0:8000
|