Define docker_login_with_retry in base and CICD build jobs
Some checks failed
CICD / Build and Publish CICD Base Image (pull_request) Successful in 50m40s
CICD / Build and Push CICD Image (pull_request) Successful in 44m14s
CICD / Build CICD Image Failure Postmortem (pull_request) Has been skipped
CICD / Frontend Dependency Audit (pull_request) Failing after 1h12m28s
CICD / CICD Tests Complete (pull_request) Has been cancelled
CICD / Build Backend Base Image (pull_request) Has been cancelled
CICD / Build Frontend Base Image (pull_request) Has been cancelled
CICD / Build Integration Tester Image (pull_request) Has been cancelled
CICD / Build E2E Tester Image (pull_request) Has been cancelled
CICD / Build Backend Main Image (pull_request) Has been cancelled
CICD / Build Frontend Main Image (pull_request) Has been cancelled
CICD / Production Images Complete (pull_request) Has been cancelled
CICD / Production Image Failures Postmortem (pull_request) Has been cancelled
CICD / Source Lanes Failure Postmortem (pull_request) Has been cancelled
CICD / Runtime Black-Box Integration Tests (pull_request) Has been cancelled
CICD / Integration Tests Failure Postmortem (pull_request) Has been cancelled
CICD / End-to-End Tests (pull_request) Has been cancelled
CICD / E2E Tests Failure Postmortem (pull_request) Has been cancelled
CICD / Source Checks (pull_request) Has been cancelled
CICD / Backend Dependency Audit (pull_request) Has been cancelled

This commit is contained in:
copilotcoder
2026-07-15 17:16:50 -04:00
parent 58b1ac7c08
commit 8357662f45

View File

@@ -314,6 +314,25 @@ jobs:
rm -f "${headers_file}"
}
docker_login_with_retry() {
attempts="${1:-5}"
backoff="${2:-3}"
attempt=1
while [ "${attempt}" -le "${attempts}" ]; do
ensure_registry_auth_realm_host
if echo "${PACKAGE_ACCESS_TOKEN}" | docker login "http://${GITEA_REGISTRY}" -u "${REGISTRY_USER}" --password-stdin; then
return 0
fi
if [ "${attempt}" -lt "${attempts}" ]; then
sleep_seconds=$((backoff * attempt))
echo "docker login failed; retrying in ${sleep_seconds}s"
sleep "${sleep_seconds}"
fi
attempt=$((attempt + 1))
done
return 1
}
if ! grep -q "${GITEA_REGISTRY_HOST}" /etc/hosts; then
echo "${GITEA_REGISTRY_IP} ${GITEA_REGISTRY_HOST}" >> /etc/hosts
fi
@@ -516,6 +535,25 @@ jobs:
rm -f "${headers_file}"
}
docker_login_with_retry() {
attempts="${1:-5}"
backoff="${2:-3}"
attempt=1
while [ "${attempt}" -le "${attempts}" ]; do
ensure_registry_auth_realm_host
if echo "${PACKAGE_ACCESS_TOKEN}" | docker login "http://${GITEA_REGISTRY}" -u "${REGISTRY_USER}" --password-stdin; then
return 0
fi
if [ "${attempt}" -lt "${attempts}" ]; then
sleep_seconds=$((backoff * attempt))
echo "docker login failed; retrying in ${sleep_seconds}s"
sleep "${sleep_seconds}"
fi
attempt=$((attempt + 1))
done
return 1
}
echo "=== Pre-build disk telemetry ==="
df -h || true
if command -v docker >/dev/null 2>&1; then