Commit b0b726a0 authored by Craig Miskell's avatar Craig Miskell

Ex 5

parent 4f4b663f
......@@ -17,8 +17,16 @@ before_script:
tf_format:
stage: format
script: git diff-tree --no-commit-id --name-only -r ${CI_COMMIT_SHA} | grep '\.tf$' | tee
# script: git diff-tree --no-commit-id --name-only -r ${CI_COMMIT_SHA} | grep '\.tf$' | xargs -I{} /terraform fmt -write=false {} | sed '/^\s*$/d'
script: |
#!/bin/sh
set +o pipefail
fmt_diff=$(git diff-tree --no-commit-id --name-only -r ${CI_COMMIT_SHA} | grep '\.tf$' | xargs -I{} /terraform fmt -write=false {} | sed '/^\s*$/d')
if test -n "$fmt_diff"; then
echo "******* Terraform formatting error:"
echo ""
echo $fmt_diff
exit 1
fi
tf_validate:
stage: validate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment