From 926bcf11617802056830373f9c3cead785b9e2b2 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 10 May 2021 21:31:59 +0200 Subject: [PATCH] feat: add terraform (#39) Co-authored-by: Rhys Arkins --- Dockerfile.bionic | 3 +++ src/usr/local/buildpack/tools/terraform.sh | 19 +++++++++++++++++++ test/latest/Dockerfile | 8 ++++++++ 3 files changed, 30 insertions(+) create mode 100644 src/usr/local/buildpack/tools/terraform.sh diff --git a/Dockerfile.bionic b/Dockerfile.bionic index 984043e68..de18adc2c 100644 --- a/Dockerfile.bionic +++ b/Dockerfile.bionic @@ -93,3 +93,6 @@ RUN install-tool rust 1.52.0 # renovate: datasource=docker versioning=docker RUN install-tool swift 5.4.0 + +# renovate: datasource=docker lookupName=hashicorp/terraform versioning=docker +RUN install-tool terraform 0.15.3 diff --git a/src/usr/local/buildpack/tools/terraform.sh b/src/usr/local/buildpack/tools/terraform.sh new file mode 100644 index 000000000..9e0f3eacd --- /dev/null +++ b/src/usr/local/buildpack/tools/terraform.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +check_semver ${TERRAFORM_VERSION} + +if [[ ! "${MAJOR}" || ! "${MINOR}" || ! "${PATCH}" ]]; then + echo Invalid version: ${TERRAFORM_VERSION} + exit 1 +fi + +DISTRO=linux_amd64 +URL=https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${DISTRO}.zip + +curl -sL $URL -o tmp.zip +unzip -d /usr/local/bin/ tmp.zip +rm tmp.zip + +terraform version diff --git a/test/latest/Dockerfile b/test/latest/Dockerfile index 20cf8f4b8..6ed0a3e7c 100644 --- a/test/latest/Dockerfile +++ b/test/latest/Dockerfile @@ -108,6 +108,13 @@ RUN install-tool powershell v7.1.3 RUN set -ex; cat /etc/hosts; \ nginx && SSL_CERT_FILE=/test/ca.pem pwsh -c "&{ \$ErrorActionPreference='Stop'; invoke-webrequest https://buildkitsandbox }" +#-------------------------------------- +# test: terraform +#-------------------------------------- +FROM build as testg +# renovate: datasource=docker lookupName=hashicorp/terraform versioning=docker +RUN install-tool terraform 0.15.3 + #-------------------------------------- # final #-------------------------------------- @@ -119,3 +126,4 @@ COPY --from=testc /.dummy /.dummy COPY --from=testd /.dummy /.dummy COPY --from=teste /.dummy /.dummy COPY --from=testf /.dummy /.dummy +COPY --from=testg /.dummy /.dummy