Skip to content

Commit

Permalink
feat: add terraform (#39)
Browse files Browse the repository at this point in the history
Co-authored-by: Rhys Arkins <[email protected]>
  • Loading branch information
viceice and rarkins authored May 10, 2021
1 parent f7beb7e commit 926bcf1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Dockerfile.bionic
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 19 additions & 0 deletions src/usr/local/buildpack/tools/terraform.sh
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions test/latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
#--------------------------------------
Expand All @@ -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

0 comments on commit 926bcf1

Please sign in to comment.