Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): improve retry errors for github installs #505

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions github-release-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@

ORG_PROJ=${1}
ARCH_FILTER=${2}
LATEST=${3}

usage() {
echo "$0 ORG_PROJ ARCH_FILTER"
echo " ORG_PROJ - organization/projectname"
echo " ARCH_FILTER - optional extra filter to further limit rpm selection"
echo " LATEST - optional tag override for latest release (eg, nightly-dev)"

}

Expand All @@ -32,10 +34,20 @@ if [ -z ${ARCH_FILTER} ]; then
exit 2
fi

if [ -z ${LATEST} ]; then
RELTAG="latest"
else
RELTAG="tags/${LATEST}"
fi

set -ouex pipefail

API="https://api.github.com/repos/${ORG_PROJ}/releases/latest"
RPM_URLS=$(curl --retry 3 --retry-delay 3 --retry-all-errors -sL ${API} \
API_JSON=$(mktemp /tmp/api-XXXXXXXX.json)
API="https://api.github.com/repos/${ORG_PROJ}/releases/${RELTAG}"

# retry up to 5 times with 5 second delays for any error included HTTP 404 etc
curl --fail --retry 5 --retry-delay 5 --retry-all-errors -sL ${API} -o ${API_JSON}
RPM_URLS=$(cat ${API_JSON} \
| jq \
-r \
--arg arch_filter "${ARCH_FILTER}" \
Expand Down
Loading