Smoke-test phpPgAdmin inside the container network
This commit is contained in:
1 parent
98c9cd1f72
commit
61d54e9b17
1 file changed
+4
-4
@@ -68,12 +68,12 @@ jobs:
|
||||
if (!extension_loaded($extension)) { fwrite(STDERR, "Missing PHP extension: {$extension}\n"); exit(1); }
|
||||
}
|
||||
'
|
||||
container_id=$(podman run --detach --publish 127.0.0.1::80 "${IMAGE}:${COMMIT_SHA}")
|
||||
container_id=$(podman run --detach "${IMAGE}:${COMMIT_SHA}")
|
||||
trap 'podman rm --force "$container_id" >/dev/null 2>&1 || true' EXIT
|
||||
port=$(podman inspect --format '{{ (index (index .NetworkSettings.Ports "80/tcp") 0).HostPort }}' "$container_id")
|
||||
for attempt in {1..30}; do
|
||||
if curl --fail --silent --show-error "http://127.0.0.1:${port}/phppgadmin/" -o "${RUNNER_TEMP}/page.html" \
|
||||
&& grep -Fq phpPgAdmin "${RUNNER_TEMP}/page.html"; then exit 0; fi
|
||||
if podman exec "$container_id" curl --fail --silent --show-error \
|
||||
http://127.0.0.1/phppgadmin/ -o /tmp/phppgadmin-smoke.html \
|
||||
&& podman exec "$container_id" grep -Fq phpPgAdmin /tmp/phppgadmin-smoke.html; then exit 0; fi
|
||||
sleep 1
|
||||
done
|
||||
podman logs "$container_id"
|
||||
|
||||
Reference in new issue
Block a user