Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
terraform validates with Travis CI
env:
- tf_version=0.8.8
- tf_version=0.9.11
sudo: required
language: bash
before_install:
- wget https://releases.hashicorp.com/terraform/${tf_version}/terraform_${tf_version}_linux_amd64.zip -O /tmp/terraform.zip
- sudo unzip -d /usr/local/bin/ /tmp/terraform.zip
script:
- make test
- make fmt
modules = $(shell find . -type f -name "*.tf" -exec dirname {} \;|sort -u)
.PHONY: test
default: test
test:
@for m in $(modules); do (terraform validate "$$m" && echo "$$m") || exit 1 ; done
fmt:
@if [ `terraform fmt | wc -c` -ne 0 ]; then echo "terraform files need be formatted"; exit 1; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.