- 
                Notifications
    
You must be signed in to change notification settings  - Fork 219
 
USHIFT-6282: 'brew download-build' command fails #5679
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -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}/" | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we make the  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, I missed that, I'll do it There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.  | 
||
| 
     | 
||
| 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 | ||
| # | ||
| 
          
            
          
           | 
    ||
There was a problem hiding this comment.
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?