Fix missing registry auth helper in build_cicd job
Some checks failed
CICD / Build and Push CICD Image (push) Has been cancelled
CICD / Build CICD Image Failure Postmortem (push) Has been cancelled
CICD / Backend Tests (push) Has been cancelled
CICD / Pre-commit Checks (push) Has been cancelled
CICD / Frontend Tests (push) Has been cancelled
CICD / Backend Doctests (push) Has been cancelled
CICD / CICD Tests Complete (push) Has been cancelled
CICD / Build Backend Base Image (push) Has been cancelled
CICD / Build Frontend Base Image (push) Has been cancelled
CICD / Build Integration Tester Image (push) Has been cancelled
CICD / Build E2E Tester Image (push) Has been cancelled
CICD / Build and Publish Runtime Images (Legacy Disabled) (push) Has been cancelled
CICD / Build Backend Main Image (push) Has been cancelled
CICD / Build Frontend Main Image (push) Has been cancelled
CICD / Production Images Complete (push) Has been cancelled
CICD / Runtime Images Failure Postmortem (push) Has been cancelled
CICD / Source Lanes Failure Postmortem (push) Has been cancelled
CICD / Runtime Black-Box Integration Tests (push) Has been cancelled
CICD / Integration Tests Failure Postmortem (push) Has been cancelled
CICD / End-to-End Tests (push) Has been cancelled
CICD / E2E Tests Failure Postmortem (push) Has been cancelled
CICD / Build and Publish CICD Base Image (push) Has started running

This commit is contained in:
copilotcoder
2026-07-09 23:33:26 -04:00
parent c4d1102f6f
commit 955be4e2ec

View File

@@ -448,6 +448,27 @@ jobs:
return 1
}
ensure_registry_auth_realm_host() {
if ! grep -q "${GITEA_REGISTRY_HOST}" /etc/hosts; then
echo "${GITEA_REGISTRY_IP} ${GITEA_REGISTRY_HOST}" >> /etc/hosts
fi
headers_file="$(mktemp)"
if curl -sSI "http://${GITEA_REGISTRY}/v2/" >"${headers_file}"; then
realm_url="$(sed -n 's/.*realm="\([^"]*\)".*/\1/p' "${headers_file}" | head -n 1)"
if [ -n "${realm_url}" ]; then
realm_host="$(printf '%s' "${realm_url}" | sed -E 's#^https?://([^/:]+).*$#\1#')"
if [ -n "${realm_host}" ] && [ "${realm_host}" != "${GITEA_REGISTRY_HOST}" ]; then
if ! grep -q "${realm_host}" /etc/hosts; then
echo "${GITEA_REGISTRY_IP} ${realm_host}" >> /etc/hosts
echo "Pinned registry auth realm host: ${realm_host} -> ${GITEA_REGISTRY_IP}"
fi
fi
fi
fi
rm -f "${headers_file}"
}
echo "=== Pre-build disk telemetry ==="
df -h || true
if command -v docker >/dev/null 2>&1; then