diff --git a/.gitea/workflows/cicd-base.yml b/.gitea/workflows/cicd-base.yml index 2b8157f..2b00875 100644 --- a/.gitea/workflows/cicd-base.yml +++ b/.gitea/workflows/cicd-base.yml @@ -287,19 +287,47 @@ jobs: echo "${PACKAGE_ACCESS_TOKEN}" | docker login "http://${GITEA_REGISTRY}" -u "${REGISTRY_USER}" --password-stdin >/dev/null 2>&1 - for i in 1 2 3 4 5 6; do - echo "Verification attempt ${i}/6 for ${BASE_REF_HASH}..." + if ! command -v skopeo >/dev/null 2>&1; then + if command -v apt-get >/dev/null 2>&1; then + apt-get update && apt-get install -y skopeo + elif command -v apk >/dev/null 2>&1; then + apk add --no-cache skopeo + fi + fi - if timeout 30 docker manifest inspect "${BASE_REF_HASH}" >/dev/null 2>&1 && \ - timeout 60 docker pull "${BASE_REF_HASH}" >/dev/null 2>&1; then - echo "✓ Published base image verified: ${BASE_REF_HASH}" - exit 0 + if ! command -v skopeo >/dev/null 2>&1; then + echo "❌ skopeo not available for verification" + exit 1 + fi + + for i in 1 2 3 4 5 6 7 8 9 10 11 12; do + echo "Verification attempt ${i}/12 for ${BASE_REF_HASH}..." + + if skopeo inspect \ + --creds "${REGISTRY_USER}:${PACKAGE_ACCESS_TOKEN}" \ + --tls-verify=false \ + "docker://${BASE_REF_HASH}" >/tmp/cicd-base-verify.json 2>/tmp/cicd-base-verify.err; then + echo "✓ Registry manifest verified for ${BASE_REF_HASH}" + + if docker pull "${BASE_REF_HASH}" >/dev/null 2>&1; then + echo "✓ Published base image is pullable: ${BASE_REF_HASH}" + exit 0 + fi + + echo "⚠ Manifest is visible but docker pull still failed; retrying." + else + echo "⚠ Verification attempt ${i} failed:" + cat /tmp/cicd-base-verify.err fi - if [ "${i}" -lt 6 ]; then - sleep 10 + if [ "${i}" -lt 12 ]; then + sleep 20 fi done - echo "❌ Published base image could not be verified: ${BASE_REF_HASH}" + echo "❌ Published base image could not be verified after 12 attempts: ${BASE_REF_HASH}" + if [ -f /tmp/cicd-base-verify.err ]; then + echo "=== Last verification error ===" + cat /tmp/cicd-base-verify.err + fi exit 1