CICD debugging again
All checks were successful
CICD Start / Sanity and Base Decision (pull_request) Successful in 1m8s
All checks were successful
CICD Start / Sanity and Base Decision (pull_request) Successful in 1m8s
Signed-off-by: copilotcoder <copilotcoder@darkhelm.org>
This commit is contained in:
@@ -141,7 +141,7 @@ jobs:
|
||||
echo "${GITEA_REGISTRY_IP} ${GITEA_REGISTRY_HOST}" >> /etc/hosts
|
||||
fi
|
||||
|
||||
API_BASE="http://${GITEA_REGISTRY_IP}:3000/api/v1"
|
||||
API_BASE="http://${GITEA_REGISTRY_IP}:3001/api/v1"
|
||||
REPO_OWNER="${REPO_FULL%/*}"
|
||||
REPO_NAME="${REPO_FULL#*/}"
|
||||
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
||||
|
||||
@@ -173,11 +173,6 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -q "${GITEA_REGISTRY_HOST}" /etc/hosts; then
|
||||
echo "${GITEA_REGISTRY_IP} ${GITEA_REGISTRY_HOST}" >> /etc/hosts
|
||||
fi
|
||||
|
||||
API_BASE="http://${GITEA_REGISTRY_IP}:3000/api/v1"
|
||||
REPO_OWNER="${REPO_FULL%/*}"
|
||||
REPO_NAME="${REPO_FULL#*/}"
|
||||
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
||||
@@ -200,19 +195,46 @@ jobs:
|
||||
EOF
|
||||
)
|
||||
|
||||
DISPATCH_URL="${API_BASE}/repos/${REPO_OWNER}/${REPO_NAME}/actions/workflows/${TARGET_WORKFLOW}/dispatches"
|
||||
RESPONSE_FILE="/tmp/dispatch-response.txt"
|
||||
: > "${RESPONSE_FILE}"
|
||||
HTTP_CODE=$(curl -sS -o "${RESPONSE_FILE}" -w "%{http_code}" -X POST \
|
||||
-H "Authorization: token ${DISPATCH_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${DISPATCH_URL}" \
|
||||
-d "${payload}" || true)
|
||||
CANDIDATE_API_BASES=()
|
||||
if [ -n "${GITHUB_SERVER_URL:-}" ]; then
|
||||
CANDIDATE_API_BASES+=("${GITHUB_SERVER_URL%/}/api/v1")
|
||||
fi
|
||||
if [ -n "${GITEA_SSH_HOST:-}" ]; then
|
||||
CANDIDATE_API_BASES+=("http://${GITEA_SSH_HOST}:3001/api/v1")
|
||||
fi
|
||||
if [ -n "${GITEA_REGISTRY_HOST:-}" ]; then
|
||||
CANDIDATE_API_BASES+=("http://${GITEA_REGISTRY_HOST}:3001/api/v1")
|
||||
fi
|
||||
if [ -n "${GITEA_REGISTRY_IP:-}" ]; then
|
||||
CANDIDATE_API_BASES+=("http://${GITEA_REGISTRY_IP}:3001/api/v1")
|
||||
fi
|
||||
|
||||
if [ "${HTTP_CODE}" -lt 200 ] || [ "${HTTP_CODE}" -ge 300 ]; then
|
||||
echo "❌ Dispatch failed with HTTP ${HTTP_CODE}"
|
||||
echo "Dispatch URL: ${DISPATCH_URL}"
|
||||
echo "Response body:"
|
||||
cat "${RESPONSE_FILE}" || true
|
||||
dispatched=false
|
||||
for API_BASE in "${CANDIDATE_API_BASES[@]}"; do
|
||||
DISPATCH_URL="${API_BASE}/repos/${REPO_OWNER}/${REPO_NAME}/actions/workflows/${TARGET_WORKFLOW}/dispatches"
|
||||
RESPONSE_FILE="/tmp/dispatch-response.txt"
|
||||
: > "${RESPONSE_FILE}"
|
||||
|
||||
HTTP_CODE=$(curl -sS -o "${RESPONSE_FILE}" -w "%{http_code}" -X POST \
|
||||
-H "Authorization: token ${DISPATCH_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${DISPATCH_URL}" \
|
||||
-d "${payload}" || true)
|
||||
|
||||
if [ "${HTTP_CODE}" -ge 200 ] && [ "${HTTP_CODE}" -lt 300 ]; then
|
||||
echo "✓ Dispatch succeeded via ${API_BASE}"
|
||||
dispatched=true
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Dispatch attempt failed via ${API_BASE} (HTTP ${HTTP_CODE})"
|
||||
if [ -s "${RESPONSE_FILE}" ]; then
|
||||
echo "Response body:"
|
||||
cat "${RESPONSE_FILE}"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${dispatched}" != "true" ]; then
|
||||
echo "❌ Dispatch failed on all candidate API endpoints"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
echo "${GITEA_REGISTRY_IP} ${GITEA_REGISTRY_HOST}" >> /etc/hosts
|
||||
fi
|
||||
|
||||
API_BASE="http://${GITEA_REGISTRY_IP}:3000/api/v1"
|
||||
API_BASE="http://${GITEA_REGISTRY_IP}:3001/api/v1"
|
||||
REPO_OWNER="${REPO_FULL%/*}"
|
||||
REPO_NAME="${REPO_FULL#*/}"
|
||||
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
||||
|
||||
@@ -357,7 +357,7 @@ jobs:
|
||||
echo "${GITEA_REGISTRY_IP} ${GITEA_REGISTRY_HOST}" >> /etc/hosts
|
||||
fi
|
||||
|
||||
API_BASE="http://${GITEA_REGISTRY_IP}:3000/api/v1"
|
||||
API_BASE="http://${GITEA_REGISTRY_IP}:3001/api/v1"
|
||||
REPO_OWNER="${REPO_FULL%/*}"
|
||||
REPO_NAME="${REPO_FULL#*/}"
|
||||
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
||||
|
||||
@@ -173,7 +173,7 @@ jobs:
|
||||
echo "${GITEA_REGISTRY_IP} ${GITEA_REGISTRY_HOST}" >> /etc/hosts
|
||||
fi
|
||||
|
||||
API_BASE="http://${GITEA_REGISTRY_IP}:3000/api/v1"
|
||||
API_BASE="http://${GITEA_REGISTRY_IP}:3001/api/v1"
|
||||
REPO_OWNER="${REPO_FULL%/*}"
|
||||
REPO_NAME="${REPO_FULL#*/}"
|
||||
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
||||
|
||||
Reference in New Issue
Block a user