-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass local AWS env vars to Terraform, tf fmt
Also rearrange the order of the validation scripts to fmt first
- Loading branch information
1 parent
fde7251
commit 5858fb8
Showing
3 changed files
with
10 additions
and
8 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,22 +27,22 @@ echo "Linting packer files" | |
$DOCKER_PACKER validate app/packer/machines/web-server.json | ||
|
||
# Ensure that `terraform fmt` comes up clean | ||
if [[ "$SKIP_TERRAFORM" == "false" ]]; then | ||
echo "Linting terraform files for correctness" | ||
if [[ "${SKIP_TERRAFORM:-false}" == "false" ]]; then | ||
DOCKER_TERRAFORM=$(get_docker_terraform) | ||
init_terraform | ||
$DOCKER_TERRAFORM validate \ | ||
-var 'newrelic_license_key=ZZZZ' \ | ||
-var 'newrelic_api_key=ZZZZ' \ | ||
-var '[email protected]' \ | ||
echo "Linting terraform files for formatting" | ||
fmt=$($DOCKER_TERRAFORM fmt) | ||
if [[ -n "$fmt" ]]; then | ||
echo 'ERROR: these files are not formatted correctly. Run "terraform fmt"' | ||
echo "$fmt" | ||
git diff | ||
exit 1 | ||
fi | ||
echo "Linting terraform files for correctness" | ||
init_terraform | ||
$DOCKER_TERRAFORM validate \ | ||
-var 'newrelic_license_key=ZZZZ' \ | ||
-var 'newrelic_api_key=ZZZZ' \ | ||
-var '[email protected]' \ | ||
echo "Linting terraform files for formatting" | ||
fi | ||
|
||
echo "Linting shell scripts" | ||
|
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