Stabilize self-hosted CI workflows and resolve issue #62 #73
@@ -2320,7 +2320,6 @@ jobs:
|
||||
DB_PASSWORD="plex_password"
|
||||
DB_URL="postgresql://plex_user:${DB_PASSWORD}@database:5432/plex_playlist"
|
||||
E2E_REPO_DIR="$(mktemp -d)"
|
||||
FRONTEND_URL_COMPOSE="http://frontend:80"
|
||||
|
||||
if ! command -v docker >/dev/null 2>&1; then
|
||||
echo "❌ Docker is required"
|
||||
@@ -2412,44 +2411,6 @@ jobs:
|
||||
echo "${http_code}"
|
||||
}
|
||||
|
||||
fetch_url_from_backend() {
|
||||
target_url="$1"
|
||||
output_file="$2"
|
||||
probe_tmp="$(mktemp)"
|
||||
|
||||
if ! docker run --rm \
|
||||
--network "${COMPOSE_PROJECT_NAME}_default" \
|
||||
"${INTEGRATION_TESTER_DIGEST_REF}" \
|
||||
python -c "$(printf '%s\n' \
|
||||
'import sys' \
|
||||
'import urllib.error' \
|
||||
'import urllib.request' \
|
||||
'target_url = sys.argv[1]' \
|
||||
'try:' \
|
||||
' with urllib.request.urlopen(target_url, timeout=2) as response:' \
|
||||
' body = response.read().decode(\"utf-8\", errors=\"replace\")' \
|
||||
' print(response.status)' \
|
||||
' print(body)' \
|
||||
'except urllib.error.HTTPError as err:' \
|
||||
' body = err.read().decode(\"utf-8\", errors=\"replace\")' \
|
||||
' print(err.code)' \
|
||||
' print(body)' \
|
||||
'except Exception:' \
|
||||
' print(\"000\")' \
|
||||
' print("")')" \
|
||||
"${target_url}" >"${probe_tmp}" 2>/dev/null; then
|
||||
: >"${output_file}"
|
||||
rm -f "${probe_tmp}"
|
||||
echo "000"
|
||||
return 0
|
||||
fi
|
||||
|
||||
http_code="$(head -n 1 "${probe_tmp}")"
|
||||
tail -n +2 "${probe_tmp}" >"${output_file}"
|
||||
rm -f "${probe_tmp}"
|
||||
echo "${http_code}"
|
||||
}
|
||||
|
||||
dump_failure_context() {
|
||||
echo "=== Runtime E2E Failure Context ==="
|
||||
docker compose -p "${COMPOSE_PROJECT_NAME}" -f "${COMPOSE_FILE}" ps || true
|
||||
@@ -2643,13 +2604,10 @@ jobs:
|
||||
for i in $(seq 1 30); do
|
||||
frontend_running_count="$(docker compose -p "${COMPOSE_PROJECT_NAME}" -f "${COMPOSE_FILE}" ps --status running --services frontend | wc -l)"
|
||||
if [ "${frontend_running_count}" -gt 0 ]; then
|
||||
frontend_root_code="$(fetch_url_from_backend "${FRONTEND_URL_COMPOSE}" /tmp/e2e-frontend-root.html)"
|
||||
case "${frontend_root_code}" in
|
||||
2*|3*)
|
||||
frontend_ready=true
|
||||
break
|
||||
;;
|
||||
esac
|
||||
if docker compose -p "${COMPOSE_PROJECT_NAME}" -f "${COMPOSE_FILE}" exec -T frontend sh -lc 'wget -q -T 2 -O /dev/null http://127.0.0.1/'; then
|
||||
frontend_ready=true
|
||||
break
|
||||
fi
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user