VRE Backend API and Scheduler
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.
 
 
 
 
 

30 lines
1.0 KiB

#!/bin/sh
if [ "$DATABASE" = "postgres" ]; then
echo "Waiting for postgres..."
while ! nc -z $DATABASE_HOST $DATABASE_PORT; do
sleep 0.1
done
echo "PostgreSQL started"
fi
# Make migrations and migrate the database.
echo "Migrating the database. "
# Should migrations not already be made.....
# python manage.py makemigrations --noinput
python manage.py migrate --noinput
python manage.py collectstatic --noinput
# This initial data. Will check if there is existing data, then no data is imported
python manage.py dockersetup --loaddata 1 NA NA NA
# Create a super user
python manage.py dockersetup --nokey 1 ${DJANGO_ADMIN_NAME} ${DJANGO_ADMIN_PASSWORD} ${DJANGO_ADMIN_EMAIL}
# Create the HAWK REST user
python manage.py dockersetup --key ${DROPOFF_API_HAWK_KEY} --secret ${DROPOFF_API_HAWK_SECRET} ${DROPOFF_API_USER} ${DROPOFF_API_PASSWORD} ${DROPOFF_API_EMAIL}
# Create the VRW REST user
python manage.py dockersetup --group ${VRW_API_GROUP} ${VRW_API_USER} ${VRW_API_PASSWORD} ${VRW_API_EMAIL}
exec "$@"