From f5cd2c5e09b8baeba357d6810e2046667c1d4580 Mon Sep 17 00:00:00 2001 From: Paul Maddox Date: Thu, 8 Mar 2018 10:03:55 +0000 Subject: [PATCH] Better CloudFormation validation output in tests --- tests/validate-templates.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/validate-templates.sh b/tests/validate-templates.sh index f8442668..6c6d96b4 100755 --- a/tests/validate-templates.sh +++ b/tests/validate-templates.sh @@ -1,16 +1,18 @@ #!/bin/bash ERROR_COUNT=0; +echo "Validating AWS CloudFormation templates..." + # Loop through the YAML templates in this repository for TEMPLATE in $(find . -name '*.yaml'); do # Validate the template with CloudFormation ERRORS=$(aws cloudformation validate-template --template-body file://$TEMPLATE 2>&1 >/dev/null); - if [ "$?" -gt "0" ]; then - ((ERROR_COUNT++)); - echo "$TEMPLATE: $ERRORS"; + echo "[fail] $TEMPLATE: $ERRORS"; + else + echo "[pass] $TEMPLATE"; fi; done; @@ -18,4 +20,4 @@ done; echo "$ERROR_COUNT template validation error(s)"; if [ "$ERROR_COUNT" -gt 0 ]; then exit 1; -fi \ No newline at end of file +fi