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 errror is found.
  • Loading branch information
diodonfrost committed Dec 4, 2020
1 parent a51e4d6 commit a22e396
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 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,14 +9,8 @@ terraform -version
terraform init

# Test Terraform syntax
terraform validate \
-var "region=${AWS_REGION}" \
-var "name=stop-aws-resources" \
-var "cloudwatch_schedule_expression=cron(0 22 ? * MON-FRI *)" \
-var "schedule_action=stop" \
-var "ec2_schedule=true" \
-var "rds_schedule=true" \
-var "autoscaling_schedule=true"
export AWS_DEFAULT_REGION=eu-west-1
terraform validate

# Terraform lint
terraform fmt -check -diff main.tf
Expand Down

0 comments on commit a22e396

Please sign in to comment.