generated from Patagia/template-nix
feat(devel): postgresql dev server
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
This commit is contained in:
parent
d5ab8058f2
commit
799bc2bc45
1 changed files with 28 additions and 1 deletions
29
justfile
29
justfile
|
@ -49,8 +49,35 @@ open-api:
|
|||
cargo xtask open-api
|
||||
|
||||
# Run all tests
|
||||
check: check-nix
|
||||
check: check-nix
|
||||
|
||||
# check-nix
|
||||
check-nix:
|
||||
nix flake check
|
||||
|
||||
# Run PostgreSQL for development and testing
|
||||
dev-postgres:
|
||||
mkdir -p "$XDG_RUNTIME_DIR/patagia-postgres"
|
||||
podman volume exists patagia-postgres || podman volume create patagia-postgres
|
||||
podman run \
|
||||
--detach \
|
||||
--replace \
|
||||
--name patagia-postgres \
|
||||
--env POSTGRES_DB=patagia \
|
||||
--env POSTGRES_USER=patagia \
|
||||
--env POSTGRES_PASSWORD=secret \
|
||||
--volume patagia-postgres:/var/lib/postgresql/data \
|
||||
--volume "$XDG_RUNTIME_DIR/patagia-postgres:/var/run/postgresql" \
|
||||
docker.io/postgres:17
|
||||
|
||||
# Reset PostgreSQL data and start
|
||||
dev-postgres-reset: dev-postgres-clean dev-postgres
|
||||
|
||||
# Clean up PostgreSQL data
|
||||
dev-postgres-clean:
|
||||
podman rm -f patagia-postgres || true
|
||||
podman volume rm patagia-postgres || true
|
||||
|
||||
# Connect to PostgreSQL with psql
|
||||
dev-postgres-psql:
|
||||
podman exec -it patagia-postgres psql -U patagia
|
||||
|
|
Loading…
Reference in a new issue