Skip to content

Commit

Permalink
the -check-variables option has been removed from 0.12
Browse files Browse the repository at this point in the history
Now the validator behaves as if this were `false`.
See: hashicorp/terraform#21408 (comment)

However, as a result of my investigation, the validator uses the source
module to check whether the syntax is valid and types/values are being
used correctly.

To react with the changes, this commit adds PWD=directory as an
temporary environment variable on the command execution, because validate
command seems to refer to the current directory.
  • Loading branch information
namusyaka committed Oct 9, 2019
1 parent 0633418 commit 4d37783
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ function check_terraform() {
local rval=125
# fmt is before validate for faster feedback, validate requires terraform
# init which takes time.
echo "Running terraform validate"
#shellcheck disable=SC2156
find . -name "*.tf" -exec bash -c 'PWD=$(dirname "{}") terraform validate' \;
echo "Running terraform fmt"
find_files . -name "*.tf" -print0 \
| compat_xargs -0 -n1 dirname \
Expand Down

0 comments on commit 4d37783

Please sign in to comment.