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.

20 lines
522 B

#!/bin/sh
echo "Waiting for Postgres..."
while ! nc -z "db" "5432"; do
sleep 0.1
done
echo "PostgreSQL started"
PGPASSWORD="RoEGG5g7&b" # Random generated, corresponds to the one in docker-compose.yml
if psql "postgresql://mam-web:$PGPASSWORD@db:5432/mam_docker" -t -c '\dt' | cut -d \| -f 2 | grep -qw "seminar_cisla"; then
echo "\nExistuje tabulka 'seminar_cisla' v db, testdata pravděpodobně byla vygenerována.\n"
else
python ./manage.py testdata
python ./manage.py loaddata data/*
fi
exec "$@"