Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docker/entrypoint-initializer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -e # needed to handle "exit" correctly
. /secret-file-loader.sh
. /reach_database.sh

returncode=0

initialize_data()
{
# Test types shall be initialized every time by the initializer, to make sure test types are complete
Expand Down Expand Up @@ -59,7 +61,7 @@ umask 0002
if [ "${DD_INITIALIZE}" = false ]
then
echo "Echo initialization skipped. Exiting."
exit
exit $returncode
fi
echo "Initializing."

Expand Down Expand Up @@ -102,7 +104,8 @@ EOD
then
echo "You have set 'enable_auditlog' to False in the past. It is not possible to manage auditlog in System settings anymore. If you would like to keep auditlog disabled, you need to set environmental variable DD_ENABLE_AUDITLOG to False for all Django containers (uwsgi, celeryworker & initializer)."
echo "Or there is some other error in checking script. Check logs of this container."
exit 47
returncode=47
exit $returncode
fi


Expand All @@ -129,6 +132,7 @@ docker compose exec uwsgi bash -c 'python manage.py makemigrations -v2'

EOF
echo "WARNING: Continuing startup despite missing migrations..."
returncode=52
}

echo "Migrating"
Expand All @@ -150,7 +154,7 @@ then
echo "$ docker compose exec uwsgi /bin/bash -c 'python manage.py createsuperuser'"
create_announcement_banner
initialize_data
exit
exit $returncode
fi

if [ -z "${DD_ADMIN_PASSWORD}" ]
Expand All @@ -175,3 +179,5 @@ then
create_announcement_banner
initialize_data
fi

exit $returncode