feat(ci): add dnf-retry wrapper script (#3133)

Co-authored-by: renner <80410025+renner0e@users.noreply.github.com>
This commit is contained in:
inffy 2026-11-02 14:56:28 +00:00 committed by GitHub
parent 99761ccdd3
commit f65d257565
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 1 deletions

View file

@ -153,7 +153,7 @@ TERRA_PACKAGES=(
# Fedora Tailscale is usually behind
TAILSCALE=(tailscale)
dnf -y install --from-repo="terra" "${TERRA_PACKAGES[@]}"
dnf-retry -y install --from-repo="terra" "${TERRA_PACKAGES[@]}"
COPR_PREFIX="copr:copr.fedorainfracloud.org"

View file

@ -27,5 +27,6 @@ dnf config-manager disable fedora-cisco-openh264
mkdir -p /tmp/scripts/helpers
install -Dm0755 /ctx/build_scripts/shared/utils/ghcurl /tmp/scripts/helpers/ghcurl
install -Dm0755 /ctx/build_scripts/shared/utils/dnf-retry /tmp/scripts/helpers/dnf-retry
echo "::endgroup::"

View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail
tries=5
sleep=60
for i in $(seq 1 "${tries}"); do
if [[ ${i} -gt 1 ]]; then
# echo "[+] Command failed. Waiting for ${sleep} seconds"
sleep "${sleep}"
fi
# echo "[+] Running (try: ${i}): dnf ${*}"
dnf "${@}" && r=0 && break || r=$?
done
exit "$r"