Skip to content

Commit

Permalink
test(sanity): stop sanity script when error is found
Browse files Browse the repository at this point in the history
This commit add bash option "set -e" in the sanity
script, it will stop the script if an error is found.
  • Loading branch information
diodonfrost committed Dec 20, 2020
1 parent 706bc0c commit 5c7ed0f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/sanity/terraform_tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

# Install the Latest version of Terraform
sudo pip install ansible
Expand All @@ -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
Expand Down

0 comments on commit 5c7ed0f

Please sign in to comment.