Skip to content

Commit

Permalink
DRY single curl block to download marmot
Browse files Browse the repository at this point in the history
This handles both suse and ubuntu
  • Loading branch information
oz123 committed Oct 13, 2023
1 parent bcacb79 commit 7b41a6c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ base-image:
ARG BASE_K8S_VERSION=$K8S_VERSION-$K8S_DISTRIBUTION_TAG
END

IF $TWO_NODE
RUN mkdir -p /opt/spectrocloud/bin && \
curl -sL https://github.com/maxpert/marmot/releases/download/v"${MARMOT_VERSION}"/marmot-v"${MARMOT_VERSION}"-linux-amd64-static.tar.gz | tar -zxv marmot && \
install marmot -o root -g root -m 755 /opt/spectrocloud/bin/ && \
rm -f marmot
END

IF [ "$OS_DISTRIBUTION" = "ubuntu" ] && [ "$ARCH" = "amd64" ]
RUN apt update && \
apt install --no-install-recommends zstd vim -y
Expand All @@ -249,12 +256,7 @@ base-image:
RUN rm -rf /var/cache/* && \
apt clean

# TODO: handle installation for opensuse
IF $TWO_NODE
RUN mkdir -p /opt/spectrocloud/bin && \
curl -sL https://github.com/maxpert/marmot/releases/download/v"${MARMOT_VERSION}"/marmot-v"${MARMOT_VERSION}"-linux-amd64-static.tar.gz | tar -zxv marmot && \
install marmot -o root -g root -m 755 /opt/spectrocloud/bin/ && \
rm -f marmot
RUN apt install -y sqlite3
END

Expand All @@ -275,10 +277,6 @@ base-image:
# zypper purge-kernels && \

IF $TWO_NODE
RUN mkdir -p /opt/spectrocloud/bin && \
curl -sL https://github.com/maxpert/marmot/releases/download/v"${MARMOT_VERSION}"/marmot-v"${MARMOT_VERSION}"-linux-amd64-static.tar.gz | tar -zxv marmot && \
install marmot -o root -g root -m 755 /opt/spectrocloud/bin/ && \
rm -f marmot
RUN zypper install -y sqlite3
END
RUN zypper install -y zstd vim
Expand Down

0 comments on commit 7b41a6c

Please sign in to comment.