Skip to content

Commit

Permalink
Add conftest to actual testing image.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nish Krishnan committed Feb 9, 2021
1 parent 6e0a8dd commit f245c96
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
16 changes: 0 additions & 16 deletions Dockerfile.testenv

This file was deleted.

15 changes: 15 additions & 0 deletions testing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,19 @@ RUN curl -LOks https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/ter
sudo unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/local/bin/tf/versions/${TERRAFORM_VERSION} && \
sudo ln -s /usr/local/bin/tf/versions/${TERRAFORM_VERSION}/terraform /usr/local/bin/terraform && \
rm terraform_${TERRAFORM_VERSION}_linux_amd64.zip

# Install conftest
ENV DEFAULT_CONFTEST_VERSION=0.21.0

RUN AVAILABLE_CONFTEST_VERSIONS="${DEFAULT_CONFTEST_VERSION}" && \
for VERSION in ${AVAILABLE_CONFTEST_VERSIONS}; do \
curl -LOs https://github.com/open-policy-agent/conftest/releases/download/v${VERSION}/conftest_${VERSION}_Linux_x86_64.tar.gz && \
curl -LOs https://github.com/open-policy-agent/conftest/releases/download/v${VERSION}/checksums.txt && \
sed -n "/conftest_${VERSION}_Linux_x86_64.tar.gz/p" checksums.txt | sha256sum -c && \
sudo mkdir -p /usr/local/bin/cft/versions/${VERSION} && \
sudo tar -C /usr/local/bin/cft/versions/${VERSION} -xzf conftest_${VERSION}_Linux_x86_64.tar.gz && \
sudo ln -s /usr/local/bin/cft/versions/${VERSION}/conftest /usr/local/bin/conftest${VERSION} && \
rm conftest_${VERSION}_Linux_x86_64.tar.gz && \
rm checksums.txt; \
done
RUN go get golang.org/x/tools/cmd/goimports

0 comments on commit f245c96

Please sign in to comment.