Last active
July 26, 2020 16:10
-
-
Save btower-labz/f9f60b8321307154c56dc75cb4c293f6 to your computer and use it in GitHub Desktop.
terraform-public-modules-scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'Formatting go module ...\n' && docker run --rm \ | |
-e HOME=${HOME} \ | |
-v "${HOME}:${HOME}/" \ | |
-v /etc/group:/etc/group:ro \ | |
-v /etc/passwd:/etc/passwd:ro \ | |
-u $(id -u ${USER}):$(id -g ${USER}) \ | |
-w $(pwd) \ | |
btowerlabz/docker-cloudbuild-terratest:latest go fmt "infra_test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'Init go module ...\n' && (test -f go.mod || \ | |
docker run --rm \ | |
-e HOME=${HOME} \ | |
-v "${HOME}:${HOME}/" \ | |
-v /etc/group:/etc/group:ro \ | |
-v /etc/passwd:/etc/passwd:ro \ | |
-u $(id -u ${USER}):$(id -g ${USER}) \ | |
-w $(pwd) \ | |
btowerlabz/docker-cloudbuild-terratest:latest go mod init "infra_test" \ | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'Testing module ...' && docker run --rm \ | |
-e HOME=${HOME} \ | |
-e AWS_PROFILE=terraform-infra-test \ | |
-e AWS_SDK_LOAD_CONFIG=1 \ | |
-e GOMAXPROCS=5 \ | |
-e GO111MODULE=on \ | |
-e TERRATEST_REGION=us-east-1 \ | |
-v "${HOME}:${HOME}/" \ | |
-v /etc/group:/etc/group:ro \ | |
-v /etc/passwd:/etc/passwd:ro \ | |
-v $(which terraform):/usr/local/bin/terraform:ro \ | |
-u $(id -u ${USER}):$(id -g ${USER}) \ | |
-w $(pwd) \ | |
btowerlabz/docker-cloudbuild-terratest:latest go test -v -timeout 30m -count=1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment