Perfect the entrypoint
Previously unexplored entrypoint technology has been explored. Now we can run commands after the entrypoint completes with the magical "$@" variable.
This commit is contained in:
22
scripts/entrypoint.sh
Executable file
22
scripts/entrypoint.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! $SKIP_ENTRYPOINT || [ -z $SKIP_ENTRYPOINT ]; then
|
||||
|
||||
MIGRATED=false
|
||||
|
||||
while ! $MIGRATED; do
|
||||
echo "Migrating..."
|
||||
python manage.py migrate 2> /dev/null
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
MIGRATED=true
|
||||
else
|
||||
echo "ERROR - $(date) - Migrate failed."
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
$@
|
||||
Reference in New Issue
Block a user