Created
October 15, 2018 18:25
-
-
Save rk295/36b99bc61a7c675a864d886c908da445 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
set -eEo pipefail | |
baseDir="$PWD/" | |
modules="$(find . -maxdepth 1 -type d \! -name .git -a \! -name .)" | |
for module in $modules; do | |
echo "Checking $module" | |
cd "${baseDir}${module}" || exit 1 | |
echo "Running terraform init" | |
terraform init | |
echo "Validating $module" | |
terraform validate -check-variables=false | |
echo "Style checking $module" | |
terraform fmt --diff=true --write=false --check=true | |
echo "Cleaning up" | |
rm -rf "${baseDir}${module}/.terraform" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment