From 5c7ed0f66ca1441d8f2713ff3f99e431dbca7287 Mon Sep 17 00:00:00 2001 From: diodonfrost Date: Sun, 20 Dec 2020 13:33:46 +0100 Subject: [PATCH] test(sanity): stop sanity script when error is found This commit add bash option "set -e" in the sanity script, it will stop the script if an error is found. --- tests/sanity/terraform_tests.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/sanity/terraform_tests.sh b/tests/sanity/terraform_tests.sh index 15365bc..7fddd94 100755 --- a/tests/sanity/terraform_tests.sh +++ b/tests/sanity/terraform_tests.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e # Install the Latest version of Terraform sudo pip install ansible @@ -8,12 +9,8 @@ terraform -version terraform init # Test Terraform syntax -terraform validate \ - -var "region=${AWS_REGION}" \ - -var "name=nuke-all" \ - -var "cloudwatch_schedule_expression=cron(0 4 ? * MON-FRI *)" \ - -var "exclude_resources=glacier,eip,rds" \ - -var "older_than=14d" +export AWS_DEFAULT_REGION=eu-west-1 +terraform validate # Terraform lint terraform fmt -check -diff main.tf