From 1704f98f08613bafd31996c64e83b6246b0452fe Mon Sep 17 00:00:00 2001 From: badra001 Date: Mon, 18 Jul 2022 09:00:22 -0400 Subject: [PATCH] add error output --- bin/upgrade-s3-provider.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/upgrade-s3-provider.sh b/bin/upgrade-s3-provider.sh index 2ede686..f80dc77 100755 --- a/bin/upgrade-s3-provider.sh +++ b/bin/upgrade-s3-provider.sh @@ -1,6 +1,6 @@ #!/bin/bash -VERSION="1.0.2" +VERSION="1.0.3" THIS=$(basename $0 .sh) STATUS=0 MODULE=$1 @@ -26,6 +26,7 @@ then TFCOMMAND=terraform fi +ERRORS="" FILE=$(mktemp -t tfplan.XXXXX) echo "* getting tf-plan for $MODULE resource_name $RNAME to $FILE (logfile $LOGFILE)" $TFCOMMAND plan -no-color -target=$MODULE > $FILE @@ -58,6 +59,7 @@ do then echo "* error importing resource $resource" STATUS=$(( $STATUS + 1 )) + ERRORS+=" $resource" else COUNT=$(( $COUNT + 1 )) fi @@ -77,6 +79,6 @@ then exit 0 else - echo "* some portion of import failed" + echo "* some portion of import failed: $ERRORS" exit 1 fi