Skip to content

Commit

Permalink
corrige ordem de execução de scripts entry-point
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelpezzuto committed Oct 11, 2021
1 parent 9af45c3 commit 09e6af3
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
#!/bin/sh

if [ "$DJANGO_MANAGE_MIGRATE" = "1" ]; then
echo "migrating data ..."
echo "making migrations ..."
python spf/manage.py makemigrations
echo "migrating data ..."
python spf/manage.py migrate --noinput
fi

if [ "$DJANGO_CREATE_SUPERUSER" = "1" ]; then
echo "creating superuser ..."
python spf/manage.py createsuperuser \
--noinput \
--username $DJANGO_SUPERUSER_USERNAME \
--email $DJANGO_SUPERUSER_EMAIL
fi

if [ "$DJANGO_MANAGE_LOAD_GROUP" = "1" ]; then
echo "loading groups ..."
python spf/manage.py loaddata group
Expand All @@ -16,14 +25,6 @@ if [ "$DJANGO_MANAGE_LOAD_USER" = "1" ]; then
python spf/manage.py loaddata user
fi

if [ "$DJANGO_CREATE_SUPERUSER" = "1" ]; then
echo "creating superuser ..."
python spf/manage.py createsuperuser \
--noinput \
--username $DJANGO_SUPERUSER_USERNAME \
--email $DJANGO_SUPERUSER_EMAIL
fi

if [ "$DJANGO_ADMIN_TRANSLATE" = "1" ]; then
echo "translanting messages ..."
django-admin compilemessages
Expand Down

0 comments on commit 09e6af3

Please sign in to comment.