Skip to content
Open
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
38 changes: 36 additions & 2 deletions test/bin/manage_brew_rpms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,47 @@ action_download() {
mkdir -p "${adir}"
pushd "${adir}" &>/dev/null
if ! brew download-build --arch="${arch}" --arch="noarch" "${package}" ; then
echo "ERROR: Failed to download '${package}' packages from brew"
exit 1
echo "WARNING: Failed to download '${package}' packages using brew download-build command, using curl as a fallback mechanism"
if ! brew_curl_download "${package}" "${arch}" ; then
echo "ERROR: Failed to download '${package}' packages using curl command"
popd &>/dev/null
exit 1
fi
fi
popd &>/dev/null
done
}

brew_curl_download() {
local package=$1
local arch=$2

# Parse package to extract version and build release
local version_and_release="${package#microshift-}"
local pkg_version="${version_and_release%%-*}"
local pkg_release="${version_and_release#*-}"

for current_arch in ${arch} noarch; do
local base_url="https://download-01.beak-001.prod.iad2.dc.redhat.com/rhel-9/brew/packages/microshift/${pkg_version}/${pkg_release}/${current_arch}/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if this URL is fixed or there are any other instances that might serve the same files?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make the rhel-9 configurable so that it would be easy later when new rhel versions are introduced ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I missed that, I'll do it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no references in the repo pointing to different RHEL 9 and RHEL 10. Neither there are MicroShift RPMs published for RHEL 10.
I think this should be addressed in a separate PR at the same time as other RHEL 9 references.


local rpm_files
rpm_files=$(curl -k -s "${base_url}" | sed -n 's/.*href="\([^"]*\.rpm\)".*/\1/p') || true
if [ -z "${rpm_files}" ]; then
echo "ERROR: No RPM files found at ${base_url}"
return 1
fi

echo "Downloading from: ${base_url}"
for rpm_file in ${rpm_files}; do
echo "Downloading: ${rpm_file}"
if ! curl -k -s -O "${base_url}${rpm_file}"; then
echo "ERROR: Failed to download ${rpm_file}"
return 1
fi
done
done
}

#
# Main
#
Expand Down