Automatic build of terraform acceptance test container for Docker Hub.
A container that uses Terratest by Gruntwork(https://www.gruntwork.io/) to test terraform modules.
Modify the docker command below, noting in particular:
AWS_PROFILE should be setup in your ~/.aws/credentials file and should be a test/dev account
A valid TF_VERSION is one of the values defined for TERRAFORM_VERSIONS
docker run --rm \
-e AWS_PROFILE=development \
-v ~/.aws:/root/.aws \
-v $(pwd):/go/src/app \
cozero/tf-acceptance-testing:terratest-v${TF_VERSION} test -v -run ./...
An actual command would look as follow using TF_VERSION=0.11.7 :
docker run --rm \
-e AWS_PROFILE=development \
-v ~/.aws:/root/.aws \
-v $(pwd):/go/src/app \
cozero/tf-acceptance-testing:terratest-v0.11.7 test -v -run ./...
docker run --rm \
-v $(pwd):/go/src/app \
cozero/tf-acceptance-testing:terratest-v${TF_VERSION} test -v -run ./...
Prerequisites:
Add any new constraints to the Gopkg.toml file to your liking (ref: the manual)
Build the container:
docker build . -t tf-acceptance-testing
To update the lock file, run the godep ensure command:
docker run --rm -v $(pwd):/go/src/app --entrypoint '' tf-acceptance-testing:latest dep ensure -v
Finally, commit the changes to Gopkg.lock and Gopkg.toml, update the CHANGELOG.md and create a Pull Request!
Content type
Image
Digest
Size
337 MB
Last updated
over 7 years ago
docker pull onsabimana/tf-acceptance-testing:latest-v0.11.13