feat: add terragrunt validate hook (#134)

This commit is contained in:
Prahalad Ramji 2020-08-19 20:01:42 +10:00 committed by GitHub
commit f6caf2195a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 0 deletions

23
terragrunt_validate.sh Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -e
declare -a paths
index=0
for file_with_path in "$@"; do
file_with_path="${file_with_path// /__REPLACED__SPACE__}"
paths[index]=$(dirname "$file_with_path")
let "index+=1"
done
for path_uniq in $(echo "${paths[*]}" | tr ' ' '\n' | sort -u); do
path_uniq="${path_uniq//__REPLACED__SPACE__/ }"
pushd "$path_uniq" > /dev/null
terragrunt validate
popd > /dev/null
done