Another fix for the CICD
Some checks failed
CICD Start / Sanity and Base Decision (pull_request) Failing after 1m20s
Some checks failed
CICD Start / Sanity and Base Decision (pull_request) Failing after 1m20s
Signed-off-by: copilotcoder <copilotcoder@darkhelm.org>
This commit is contained in:
@@ -131,12 +131,24 @@ jobs:
|
|||||||
REF_NAME: ${{ github.ref_name }}
|
REF_NAME: ${{ github.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
API_BASE="${GITHUB_SERVER_URL%/}/api/v1"
|
||||||
|
REPO_OWNER="${REPO_FULL%/*}"
|
||||||
|
REPO_NAME="${REPO_FULL#*/}"
|
||||||
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
||||||
|
|
||||||
./scripts/dispatch-workflow.sh \
|
payload=$(cat <<EOF
|
||||||
--token "${PACKAGE_ACCESS_TOKEN}" \
|
{
|
||||||
--repo "${REPO_FULL}" \
|
"ref": "${TARGET_REF}",
|
||||||
--workflow "cicd-tests.yaml" \
|
"inputs": {
|
||||||
--ref "${TARGET_REF}" \
|
"head_sha": "${HEAD_SHA}",
|
||||||
--head-sha "${HEAD_SHA}" \
|
"source_workflow": "CICD Checks"
|
||||||
--source-workflow "CICD Checks"
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
curl -fsS -X POST \
|
||||||
|
-H "Authorization: token ${PACKAGE_ACCESS_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${API_BASE}/repos/${REPO_OWNER}/${REPO_NAME}/actions/workflows/cicd-tests.yaml/dispatches" \
|
||||||
|
-d "${payload}"
|
||||||
|
|||||||
@@ -125,11 +125,25 @@ jobs:
|
|||||||
echo "head_sha=${GITHUB_SHA}" >> "$GITHUB_OUTPUT"
|
echo "head_sha=${GITHUB_SHA}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
for i in 1 2 3; do
|
for i in 1 2 3; do
|
||||||
if timeout 30 docker manifest inspect "${BASE_REF_HASH}" >/dev/null 2>&1 && \
|
echo "Base availability check ${i}/3 for ${BASE_REF_HASH}"
|
||||||
timeout 60 docker pull "${BASE_REF_HASH}" >/dev/null 2>&1; then
|
|
||||||
|
if timeout 30 docker manifest inspect "${BASE_REF_HASH}" >/dev/null 2>&1; then
|
||||||
|
echo "manifest_check=ok"
|
||||||
|
else
|
||||||
|
echo "manifest_check=missing_or_unreachable"
|
||||||
|
if [ "${i}" -lt 3 ]; then
|
||||||
|
sleep 20
|
||||||
|
fi
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if timeout 60 docker pull "${BASE_REF_HASH}" >/dev/null 2>&1; then
|
||||||
|
echo "pull_check=ok"
|
||||||
echo "Base rebuild needed: false"
|
echo "Base rebuild needed: false"
|
||||||
echo "base_needed=false" >> "$GITHUB_OUTPUT"
|
echo "base_needed=false" >> "$GITHUB_OUTPUT"
|
||||||
exit 0
|
exit 0
|
||||||
|
else
|
||||||
|
echo "pull_check=failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${i}" -lt 3 ]; then
|
if [ "${i}" -lt 3 ]; then
|
||||||
@@ -151,6 +165,9 @@ jobs:
|
|||||||
REF_NAME: ${{ github.ref_name }}
|
REF_NAME: ${{ github.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
API_BASE="${GITHUB_SERVER_URL%/}/api/v1"
|
||||||
|
REPO_OWNER="${REPO_FULL%/*}"
|
||||||
|
REPO_NAME="${REPO_FULL#*/}"
|
||||||
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
||||||
|
|
||||||
if [ "${BASE_NEEDED}" = "true" ]; then
|
if [ "${BASE_NEEDED}" = "true" ]; then
|
||||||
@@ -159,11 +176,20 @@ jobs:
|
|||||||
TARGET_WORKFLOW="docker-build-main.yaml"
|
TARGET_WORKFLOW="docker-build-main.yaml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./scripts/dispatch-workflow.sh \
|
payload=$(cat <<EOF
|
||||||
--token "${PACKAGE_ACCESS_TOKEN}" \
|
{
|
||||||
--repo "${REPO_FULL}" \
|
"ref": "${TARGET_REF}",
|
||||||
--workflow "${TARGET_WORKFLOW}" \
|
"inputs": {
|
||||||
--ref "${TARGET_REF}" \
|
"head_sha": "${HEAD_SHA}",
|
||||||
--head-sha "${HEAD_SHA}" \
|
"source_workflow": "CICD Start",
|
||||||
--source-workflow "CICD Start" \
|
"base_needed": "${BASE_NEEDED}"
|
||||||
--base-needed "${BASE_NEEDED}"
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
curl -fsS -X POST \
|
||||||
|
-H "Authorization: token ${PACKAGE_ACCESS_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${API_BASE}/repos/${REPO_OWNER}/${REPO_NAME}/actions/workflows/${TARGET_WORKFLOW}/dispatches" \
|
||||||
|
-d "${payload}"
|
||||||
|
|||||||
@@ -31,12 +31,24 @@ jobs:
|
|||||||
HEAD_SHA: ${{ github.sha }}
|
HEAD_SHA: ${{ github.sha }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
API_BASE="${GITHUB_SERVER_URL%/}/api/v1"
|
||||||
|
REPO_OWNER="${REPO_FULL%/*}"
|
||||||
|
REPO_NAME="${REPO_FULL#*/}"
|
||||||
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
||||||
|
|
||||||
./scripts/dispatch-workflow.sh \
|
payload=$(cat <<EOF
|
||||||
--token "${PACKAGE_ACCESS_TOKEN}" \
|
{
|
||||||
--repo "${REPO_FULL}" \
|
"ref": "${TARGET_REF}",
|
||||||
--workflow "cicd-start.yaml" \
|
"inputs": {
|
||||||
--ref "${TARGET_REF}" \
|
"head_sha": "${HEAD_SHA}",
|
||||||
--head-sha "${HEAD_SHA}" \
|
"source_workflow": "CICD"
|
||||||
--source-workflow "CICD"
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
curl -fsS -X POST \
|
||||||
|
-H "Authorization: token ${PACKAGE_ACCESS_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${API_BASE}/repos/${REPO_OWNER}/${REPO_NAME}/actions/workflows/cicd-start.yaml/dispatches" \
|
||||||
|
-d "${payload}"
|
||||||
|
|||||||
@@ -347,13 +347,25 @@ jobs:
|
|||||||
REF_NAME: ${{ github.ref_name }}
|
REF_NAME: ${{ github.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
API_BASE="${GITHUB_SERVER_URL%/}/api/v1"
|
||||||
|
REPO_OWNER="${REPO_FULL%/*}"
|
||||||
|
REPO_NAME="${REPO_FULL#*/}"
|
||||||
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
||||||
|
|
||||||
./scripts/dispatch-workflow.sh \
|
payload=$(cat <<EOF
|
||||||
--token "${PACKAGE_ACCESS_TOKEN}" \
|
{
|
||||||
--repo "${REPO_FULL}" \
|
"ref": "${TARGET_REF}",
|
||||||
--workflow "docker-build-main.yaml" \
|
"inputs": {
|
||||||
--ref "${TARGET_REF}" \
|
"head_sha": "${HEAD_SHA}",
|
||||||
--head-sha "${HEAD_SHA}" \
|
"source_workflow": "CICD Base Image",
|
||||||
--source-workflow "CICD Base Image" \
|
"base_needed": "true"
|
||||||
--base-needed "true"
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
curl -fsS -X POST \
|
||||||
|
-H "Authorization: token ${PACKAGE_ACCESS_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${API_BASE}/repos/${REPO_OWNER}/${REPO_NAME}/actions/workflows/docker-build-main.yaml/dispatches" \
|
||||||
|
-d "${payload}"
|
||||||
|
|||||||
@@ -163,12 +163,24 @@ jobs:
|
|||||||
REF_NAME: ${{ github.ref_name }}
|
REF_NAME: ${{ github.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
API_BASE="${GITHUB_SERVER_URL%/}/api/v1"
|
||||||
|
REPO_OWNER="${REPO_FULL%/*}"
|
||||||
|
REPO_NAME="${REPO_FULL#*/}"
|
||||||
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
TARGET_REF="${HEAD_REF:-${REF_NAME}}"
|
||||||
|
|
||||||
./scripts/dispatch-workflow.sh \
|
payload=$(cat <<EOF
|
||||||
--token "${PACKAGE_ACCESS_TOKEN}" \
|
{
|
||||||
--repo "${REPO_FULL}" \
|
"ref": "${TARGET_REF}",
|
||||||
--workflow "cicd-checks.yaml" \
|
"inputs": {
|
||||||
--ref "${TARGET_REF}" \
|
"head_sha": "${HEAD_SHA}",
|
||||||
--head-sha "${HEAD_SHA}" \
|
"source_workflow": "CICD Main Build"
|
||||||
--source-workflow "CICD Main Build"
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
curl -fsS -X POST \
|
||||||
|
-H "Authorization: token ${PACKAGE_ACCESS_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${API_BASE}/repos/${REPO_OWNER}/${REPO_NAME}/actions/workflows/cicd-checks.yaml/dispatches" \
|
||||||
|
-d "${payload}"
|
||||||
|
|||||||
Reference in New Issue
Block a user