14 lines
345 B
Bash
14 lines
345 B
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
: "${POSTGRES_USER:=postgres}"
|
|
: "${POSTGRES_DB:=toir}"
|
|
: "${PGPASSWORD:=change-me}"
|
|
|
|
until pg_isready -h postgres -U "$POSTGRES_USER" -d "$POSTGRES_DB" >/dev/null 2>&1; do
|
|
echo "waiting for postgres..."
|
|
sleep 2
|
|
done
|
|
|
|
psql -h postgres -U "$POSTGRES_USER" -d "$POSTGRES_DB" -v ON_ERROR_STOP=1 -f /seed/equipment-import.sql
|