Improve db readiness and build args parsing
This commit is contained in:
23
.github/workflows/python-uv-ci.yml
vendored
23
.github/workflows/python-uv-ci.yml
vendored
@@ -146,13 +146,26 @@ jobs:
|
||||
--health-retries=5 \
|
||||
postgres:16
|
||||
for i in {1..30}; do
|
||||
if docker exec "$container_name" pg_isready -U postgres > /dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
health="$(docker inspect --format '{{.State.Health.Status}}' "$container_name" 2>/dev/null || true)"
|
||||
case "$health" in
|
||||
healthy)
|
||||
break
|
||||
;;
|
||||
unhealthy)
|
||||
echo "Postgres reported unhealthy." >&2
|
||||
docker logs "$container_name" || true
|
||||
exit 1
|
||||
;;
|
||||
"")
|
||||
echo "Postgres health status unavailable." >&2
|
||||
docker logs "$container_name" || true
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
sleep 1
|
||||
done
|
||||
if ! docker exec "$container_name" pg_isready -U postgres > /dev/null 2>&1; then
|
||||
echo "Postgres did not become ready in time." >&2
|
||||
if [ "${health:-}" != "healthy" ]; then
|
||||
echo "Postgres did not become healthy in time." >&2
|
||||
docker logs "$container_name" || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user