Skip to content

Commit

Permalink
Changes Rosa source to Github releases (#49)
Browse files Browse the repository at this point in the history
This changes the Rosa cli tool source from the OpenShift mirror to the
latest Github release.  The mirror was several versions behind, and
possibly an outdated source.

Signed-off-by: Christopher Collins <[email protected]>
  • Loading branch information
clcollins authored Jun 3, 2021
1 parent e80eae4 commit 53c35cb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ENV OC_URL="https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/${O

# Replace version with a version number to pin a specific version (eg: "4.7.8")
ARG ROSA_VERSION="latest"
ENV ROSA_URL="https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/rosa/${ROSA_VERSION}"
ENV ROSA_URL="https://api.github.com/repos/openshift/rosa/releases/${ROSA_VERSION}"

# Replace "/latest" with "/tags/{tag}" to pin to a specific version (eg: "/tags/v0.4.0")
ARG OSDCTL_VERSION="latest"
Expand Down Expand Up @@ -76,15 +76,16 @@ RUN tar --extract --gunzip --no-same-owner --directory /out oc --file *.tar.gz
RUN mkdir /rosa
WORKDIR /rosa
# Download the checksum
RUN curl -sSLf ${ROSA_URL}/sha256sum.txt -o sha256sum.txt
# Download the binary tarball
RUN /bin/bash -c "curl -sSLf -O ${ROSA_URL}/$(awk -v asset="rosa-linux" '$0~asset {print $2}' sha256sum.txt)"
# Check the tarball and checksum match
RUN /bin/bash -c "curl -sSLf $(curl -sSLf ${ROSA_URL} -o - | jq -r '.assets[] | select(.name|test("rosa-linux-amd64.sha256")) | .browser_download_url') -o sha256sum.txt"
# Download the binary
# NOTE: ROSA does a different type of sha256 setup (one per file) so the "$" below is necessary to select the binary filename
# correctly, and does not use a tarball
RUN /bin/bash -c "curl -sSLf -O $(curl -sSLf ${ROSA_URL} -o - | jq -r '.assets[] | select(.name|test("rosa-linux-amd64$")) | .browser_download_url') "
# Check the binary and checksum match
RUN sha256sum --check --ignore-missing sha256sum.txt
RUN tar --extract --gunzip --no-same-owner --directory /out rosa --file *.tar.gz
RUN mv rosa-linux-amd64 /out/rosa

# Install osdctl
# osdctl doesn't provide an sha256sum, and is not in a tarball
RUN mkdir /osdctl
WORKDIR /osdctl
# Download the checksum
Expand Down

0 comments on commit 53c35cb

Please sign in to comment.