mirror of
https://github.com/esauflores/databases.git
synced 2026-03-09 06:30:34 +00:00
fix: Improve comments and structure in Justfile for clarity
This commit is contained in:
11
Justfile
11
Justfile
@@ -35,14 +35,20 @@ publish db=VARIANT:
|
|||||||
|
|
||||||
### Tests ###
|
### Tests ###
|
||||||
|
|
||||||
# Start a database and wait until it's healthy
|
# Start the database and wait until it's healthy
|
||||||
db-up db=VARIANT:
|
db-up db=VARIANT:
|
||||||
|
docker build {{db}}
|
||||||
docker compose -f {{db}}/compose.yml up -d --wait
|
docker compose -f {{db}}/compose.yml up -d --wait
|
||||||
|
|
||||||
# Stop a database and remove volumes
|
# Stop the database container but preserve data volumes
|
||||||
db-down db=VARIANT:
|
db-down db=VARIANT:
|
||||||
|
docker compose -f {{db}}/compose.yml down
|
||||||
|
|
||||||
|
# Stop the database container and remove data volumes
|
||||||
|
db-clean db=VARIANT:
|
||||||
docker compose -f {{db}}/compose.yml down -v
|
docker compose -f {{db}}/compose.yml down -v
|
||||||
|
|
||||||
|
|
||||||
# Run tests against a database variant
|
# Run tests against a database variant
|
||||||
test db=VARIANT:
|
test db=VARIANT:
|
||||||
@case "{{db}}" in \
|
@case "{{db}}" in \
|
||||||
@@ -53,6 +59,5 @@ test db=VARIANT:
|
|||||||
# Run tests against a Postgres database
|
# Run tests against a Postgres database
|
||||||
_test-postgres:
|
_test-postgres:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
trap 'just db-down postgres' EXIT
|
|
||||||
just db-up postgres
|
just db-up postgres
|
||||||
docker compose -f postgres/compose.yml exec postgres pg_isready -U ${POSTGRES_USER}
|
docker compose -f postgres/compose.yml exec postgres pg_isready -U ${POSTGRES_USER}
|
||||||
|
|||||||
Reference in New Issue
Block a user