Sign inSign up

onsabimana/tf-acceptance-testing

By onsabimana

Updated over 7 years ago

Image
0

205

onsabimana/tf-acceptance-testing repository overview

Terraform Acceptance Test Docker Image

Automatic build of terraform acceptance test container for Docker Hub.

Current Containers

build status

Synopsis

A container that uses Terratest by Gruntwork(https://www.gruntwork.io/) to test terraform modules.

What's included?

Usage

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 ./...
  • or use aws-vault, run in server mode and remove the AWS stuff
docker run --rm \
  -v $(pwd):/go/src/app \
  cozero/tf-acceptance-testing:terratest-v${TF_VERSION} test -v -run ./...

Updating dependency versions

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!

Tag summary

Content type

Image

Digest

Size

337 MB

Last updated

over 7 years ago

docker pull onsabimana/tf-acceptance-testing:latest-v0.11.13