openshift / ocm-container

Containerized environment for accessing OpenShift v4 clusters, packing necessary tools/scripts
Apache License 2.0
10 stars 63 forks source link

use full file suffix for omc binary download to fix build error #167

Closed T0MASD closed 1 year ago

T0MASD commented 1 year ago

use full file suffix for omc binary download, fixes build error:

[6/12] STEP 8/11: RUN /bin/bash -c "curl -sSLf -O $(curl -sSLf ${OMC_URL} -o - | jq -r '.assets[] | select(.name|test("Linux_x86_64")) | .browser_download_url')"
/bin/bash: line 2: https://github.com/gmeghnag/omc/releases/download/v2.5.0/omc_Linux_x86_64.tar.gz: No such file or directory
Error: building at STEP "RUN /bin/bash -c "curl -sSLf -O $(curl -sSLf ${OMC_URL} -o - | jq -r '.assets[] | select(.name|test("Linux_x86_64")) | .browser_download_url')"": while running runtime: exit status 127

this is because

OMC_URL=https://api.github.com/repos/gmeghnag/omc/releases/tags/v2.5.0
curl -sSLf ${OMC_URL} -o - | jq -r '.assets[] | select(.name|test("Linux_x86_64")) | .browser_download_url'

returns 2 results:

https://github.com/gmeghnag/omc/releases/download/v2.5.0/omc_Linux_x86_64
https://github.com/gmeghnag/omc/releases/download/v2.5.0/omc_Linux_x86_64.tar.gz

but curl expects 1 url, using omc_Linux_x86_64.tar.gz instead of omc_Linux_x86_64 because it's 3+ times smaller

AlexVulaj commented 1 year ago

/lgtm

clcollins commented 1 year ago

/lgtm /approve

openshift-ci[bot] commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlexVulaj, clcollins, T0MASD

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift/ocm-container/blob/master/OWNERS)~~ [clcollins] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment