.
This commit is contained in:
23
.github/workflows/integration-tests.yml
vendored
23
.github/workflows/integration-tests.yml
vendored
@@ -58,22 +58,21 @@ jobs:
|
|||||||
- name: Get PostgreSQL connection details
|
- name: Get PostgreSQL connection details
|
||||||
id: pg_connection
|
id: pg_connection
|
||||||
run: |
|
run: |
|
||||||
# Get container IP address
|
# Get container IP address from Docker bridge network
|
||||||
|
# This is needed because the runner itself is in a Docker container
|
||||||
CONTAINER_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' relspec-test-postgres)
|
CONTAINER_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' relspec-test-postgres)
|
||||||
echo "Container IP: $CONTAINER_IP"
|
|
||||||
|
|
||||||
# If container IP exists, use it with port 5432 (internal port)
|
if [ -z "$CONTAINER_IP" ]; then
|
||||||
# Otherwise fall back to localhost:5439
|
echo "ERROR: Could not get container IP address"
|
||||||
if [ -n "$CONTAINER_IP" ]; then
|
docker inspect relspec-test-postgres
|
||||||
echo "Using container IP: $CONTAINER_IP:5432"
|
exit 1
|
||||||
echo "pg_host=$CONTAINER_IP" >> $GITHUB_OUTPUT
|
|
||||||
echo "pg_port=5432" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "Using localhost:5439"
|
|
||||||
echo "pg_host=localhost" >> $GITHUB_OUTPUT
|
|
||||||
echo "pg_port=5439" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Container IP: $CONTAINER_IP"
|
||||||
|
echo "Using container IP: $CONTAINER_IP:5432"
|
||||||
|
echo "pg_host=$CONTAINER_IP" >> $GITHUB_OUTPUT
|
||||||
|
echo "pg_port=5432" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "=== Testing connection from inside container ==="
|
echo "=== Testing connection from inside container ==="
|
||||||
docker exec relspec-test-postgres psql -U relspec -d relspec_test -c "SELECT version();"
|
docker exec relspec-test-postgres psql -U relspec -d relspec_test -c "SELECT version();"
|
||||||
|
|||||||
Reference in New Issue
Block a user