Skip to content

Commit 53c35cb

Browse files
authored
Changes Rosa source to Github releases (#49)
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]>
1 parent e80eae4 commit 53c35cb

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Dockerfile

+8-7
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ENV OC_URL="https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/${O
3838

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

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

8688
# Install osdctl
87-
# osdctl doesn't provide an sha256sum, and is not in a tarball
8889
RUN mkdir /osdctl
8990
WORKDIR /osdctl
9091
# Download the checksum

0 commit comments

Comments
 (0)