|
@@ -92,6 +92,7 @@ if [[ ! $PARENT_PWD =~ ^aws ]]; then
|
|
|
fi
|
|
|
|
|
|
for i in `seq -f "%g*" 0 9 | sort -n`; do
|
|
|
+ EXITCODE=1 # Assume error
|
|
|
MODULE=$( basename $i )
|
|
|
if [[ -d $MODULE ]]; then
|
|
|
echo "====================================================================================="
|
|
@@ -116,6 +117,7 @@ for i in `seq -f "%g*" 0 9 | sort -n`; do
|
|
|
[[ $TESTING ]] && ${TERRAGRUNT_BIN} plan # Run a plan if testing
|
|
|
[[ $TESTING ]] || ${TERRAGRUNT_BIN} init # Run an init and apply
|
|
|
[[ $TESTING ]] || ${TERRAGRUNT_BIN} apply
|
|
|
+ EXITCODE=$?
|
|
|
popd > /dev/null
|
|
|
echo "========== Region completed: $i"
|
|
|
fi
|
|
@@ -124,21 +126,25 @@ for i in `seq -f "%g*" 0 9 | sort -n`; do
|
|
|
[[ $TESTING ]] && ${TERRAGRUNT_BIN} plan # Run a plan if testing
|
|
|
[[ $TESTING ]] || ${TERRAGRUNT_BIN} init # Run an init and apply otherwise
|
|
|
[[ $TESTING ]] || ${TERRAGRUNT_BIN} apply
|
|
|
+ EXITCODE=$?
|
|
|
fi
|
|
|
popd > /dev/null
|
|
|
echo "=======================================DONE=========================================="
|
|
|
echo ""
|
|
|
echo ""
|
|
|
|
|
|
- # Prompt to continue after each module. Easier than ctrl-c...
|
|
|
- read -p "Terragrunt completed. Continue to next module [Y/n]? " -n 1 -r
|
|
|
- echo ""
|
|
|
- if [[ $REPLY =~ ^[Nn]$ ]]
|
|
|
- then
|
|
|
- echo Exiting...
|
|
|
- exit 0
|
|
|
+ if [[ $EXITCODE != 0 ]]; then
|
|
|
+ # Prompt to continue after each module. Easier than ctrl-c...
|
|
|
+ read -p "Terragrunt completed. Continue to next module [Y/n]? " -n 1 -r
|
|
|
+ echo ""
|
|
|
+ if [[ $REPLY =~ ^[Nn]$ ]]
|
|
|
+ then
|
|
|
+ echo Exiting...
|
|
|
+ exit 1
|
|
|
+ fi
|
|
|
fi
|
|
|
fi
|
|
|
done
|
|
|
|
|
|
echo Finished.
|
|
|
+exit 0
|