db_init.sh 278 B

123456789101112
  1. #!/usr/bin/env bash
  2. set -x
  3. set -eo pipefail
  4. until psql -h "localhost" -U "${DB_USER}" -p "${DB_PORT}" -d "postgres" -c '\q';
  5. do
  6. >&2 echo "Postgres is still unavailable - sleeping"
  7. sleep 1
  8. done
  9. >&2 echo "Postgres is up and running on port ${DB_PORT}!"
  10. sqlx database create