feat(ci): add dnf-retry wrapper script (#3133)
Co-authored-by: renner <80410025+renner0e@users.noreply.github.com>
This commit is contained in:
parent
99761ccdd3
commit
f65d257565
3 changed files with 18 additions and 1 deletions
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -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::"
|
||||
|
|
|
|||
16
build_scripts/shared/utils/dnf-retry
Executable file
16
build_scripts/shared/utils/dnf-retry
Executable 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"
|
||||
|
||||
Loading…
Reference in a new issue