bug6173: in refreshInstance.sh load at least the newest 100 releases from GitHub

This commit is contained in:
Axel Uhl
2025-11-07 10:42:35 +01:00
parent c414eef8a9
commit 5a9b4f2af9
@@ -153,11 +153,11 @@ install_environment ()
load_from_release_file ()
{
if [[ ${INSTALL_FROM_RELEASE} == "" ]]; then
GITHUB_RELEASE=$( curl -L https://api.github.com/repos/SAP/sailing-analytics/releases 2>/dev/null | jq -r 'sort_by(.created_at) | reverse | map(select(.name | startswith("main-")))[0].assets[] | select(.content_type=="application/x-tar")' )
GITHUB_RELEASE=$( curl -L "https://api.github.com/repos/SAP/sailing-analytics/releases?per_page=100" 2>/dev/null | jq -r 'sort_by(.created_at) | reverse | map(select(.name | startswith("main-")))[0].assets[] | select(.content_type=="application/x-tar")' )
INSTALL_FROM_RELEASE=$( echo "${GITHUB_RELEASE}" | jq -r '.name' | sed -e 's/\.tar\.gz$//' )
echo "You didn't provide a release. Defaulting to latest main branch build ${INSTALL_FROM_RELEASE}"
else
GITHUB_RELEASE=$( curl -L https://api.github.com/repos/SAP/sailing-analytics/releases 2>/dev/null | jq -r 'sort_by(.created_at) | reverse | map(select(.name=="'${INSTALL_FROM_RELEASE}'"))[0].assets[] | select(.content_type=="application/x-tar")' )
GITHUB_RELEASE=$( curl -L "https://api.github.com/repos/SAP/sailing-analytics/releases?per_page=100" 2>/dev/null | jq -r 'sort_by(.created_at) | reverse | map(select(.name=="'${INSTALL_FROM_RELEASE}'"))[0].assets[] | select(.content_type=="application/x-tar")' )
fi
if which mail; then
if [ -n "${BUILD_COMPLETE_NOTIFY}" ]; then