Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
# wait-for-migration.sh
set -e
cmd="$@"
echo "cmd: $cmd"
until npx sequelize db:migrate; do
>&2 echo "Database is unavailable - sleeping"
sleep 1
done
>&2 echo "Database is up and migrations runned - starting application"
exec $cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.