From ba818f6a240cc04fca81a6722736e54f03554767 Mon Sep 17 00:00:00 2001 From: mauwii Date: Mon, 23 Oct 2023 23:44:37 +0200 Subject: [PATCH] add terraform, squash in mergify --- .github/mergify.yml | 2 +- linux/ubuntu/Dockerfile | 24 ++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index 4944967..5710c74 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -9,4 +9,4 @@ pull_request_rules: - '#approved-reviews-by>=1' actions: merge: - method: merge + method: squash diff --git a/linux/ubuntu/Dockerfile b/linux/ubuntu/Dockerfile index 48c8a01..ed1d61f 100644 --- a/linux/ubuntu/Dockerfile +++ b/linux/ubuntu/Dockerfile @@ -206,9 +206,22 @@ RUN KUBECTL_VERSION=$(curl -fsSL "https://dl.k8s.io/release/stable.txt") \ -o "${PATH_LOCAL_BINS}/kubectl" \ && chmod +x "${PATH_LOCAL_BINS}/kubectl" \ && curl -sSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash \ - && curl -sSL -O "https://storage.googleapis.com/minikube/releases/latest/minikube-linux-${TARGETARCH}" \ + && curl -sSLO "https://storage.googleapis.com/minikube/releases/latest/minikube-linux-${TARGETARCH}" \ && install "minikube-linux-${TARGETARCH}" "${PATH_LOCAL_BINS}/minikube" +FROM base as terraform +ARG TARGETARCH +ARG PATH_LOCAL_BINS +SHELL [ "/bin/bash", "--login", "-e", "-o", "pipefail", "-c" ] +RUN URL=$(curl -fsSL https://api.releases.hashicorp.com/v1/releases/terraform/latest \ + | jq --arg arch "$(dpkg --print-architecture)" -r '.builds[] | select((.arch==$arch) and (.os=="linux")).url') \ + && curl -sSL "${URL}" \ + -o /tmp/terraform.zip \ + && unzip \ + -qq /tmp/terraform.zip \ + -d "${PATH_LOCAL_BINS}" \ + && terraform --version + FROM base as rust ARG TARGETARCH SHELL [ "/bin/bash", "--login", "-e", "-o", "pipefail", "-c" ] @@ -406,7 +419,14 @@ RUN ln -s azcopy "${PATH_LOCAL_BINS}/azcopy10" COPY --link --from=git-lfs "${PATH_LOCAL_BINS}/git-lfs" "${PATH_LOCAL_BINS}/git-lfs" # add k8s-tools -COPY --link --from=k8s-tools "${PATH_LOCAL_BINS}/helm" "${PATH_LOCAL_BINS}/kubectl" "${PATH_LOCAL_BINS}/minikube" "${PATH_LOCAL_BINS}"/ +COPY --link --from=k8s-tools \ + "${PATH_LOCAL_BINS}/helm" \ + "${PATH_LOCAL_BINS}/kubectl" \ + "${PATH_LOCAL_BINS}/minikube" \ + "${PATH_LOCAL_BINS}"/ + +# add terraform +COPY --link --from=terraform "${PATH_LOCAL_BINS}/terraform" "${PATH_LOCAL_BINS}/terraform" # add rust ARG CARGO_HOME