Files
drive/bin/postgres_e2e
Nathan Vasse c61878253b 🔧(conf) setup handy local e2e env
We want to be able to quickly start a local isolated env for the
e2e testing, we don't want to share to same db with the classic
dev env because the e2e db should be empty before tests execution.
And we don't want to clear our dev db every time. Also provide a new
makefile handy command to launch the e2e env and the tests in one
command, great.
2025-08-27 15:45:15 +02:00

13 lines
507 B
Bash
Executable File

#!/usr/bin/env bash
# shellcheck source=bin/_config.sh
source "$(dirname "${BASH_SOURCE[0]}")/_config.sh"
# Get database credentials from environment file
ENV_FILE="${REPO_DIR}/env.d/development/postgresql.e2e"
POSTGRES_USER=$(grep POSTGRES_USER "$ENV_FILE" | cut -d'=' -f2)
POSTGRES_DB=$(grep POSTGRES_DB "$ENV_FILE" | cut -d'=' -f2)
# Execute PostgreSQL command (run as postgres user, not host user)
_docker_compose exec -T postgresql psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -v ON_ERROR_STOP=1 "$@"