chore: bootstrap independent git workflow
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
14
examples/scripts/bootstrap-postgres.sh
Executable file
14
examples/scripts/bootstrap-postgres.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
COMPOSE_FILE="${COMPOSE_FILE:-$ROOT_DIR/docker-compose.demo.yml}"
|
||||
SERVICE_NAME="${POSTGRES_SERVICE_NAME:-postgres}"
|
||||
POSTGRES_USER="${POSTGRES_USER:-dbtool}"
|
||||
POSTGRES_DB="${POSTGRES_DB:-dbtool_demo}"
|
||||
|
||||
docker compose -f "$COMPOSE_FILE" exec -T "$SERVICE_NAME" \
|
||||
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -d "$POSTGRES_DB" \
|
||||
< "$ROOT_DIR/examples/fixtures/postgres/init.sql"
|
||||
|
||||
echo "PostgreSQL demo data seeded into $POSTGRES_DB."
|
||||
Reference in New Issue
Block a user