Skip to content

Commit

Permalink
add error output
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jul 18, 2022
1 parent ded0a71 commit 1704f98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/upgrade-s3-provider.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VERSION="1.0.2"
VERSION="1.0.3"
THIS=$(basename $0 .sh)
STATUS=0
MODULE=$1
Expand All @@ -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
Expand Down Expand Up @@ -58,6 +59,7 @@ do
then
echo "* error importing resource $resource"
STATUS=$(( $STATUS + 1 ))
ERRORS+=" $resource"
else
COUNT=$(( $COUNT + 1 ))
fi
Expand All @@ -77,6 +79,6 @@ then
exit 0
else

echo "* some portion of import failed"
echo "* some portion of import failed: $ERRORS"
exit 1
fi

0 comments on commit 1704f98

Please sign in to comment.