Skip to content

Commit

Permalink
Merge branch 'main' into marrobi/issue2625
Browse files Browse the repository at this point in the history
  • Loading branch information
marrobi authored Sep 29, 2022
2 parents 9a81af3 + 87debac commit 58e10e4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions devops/scripts/terraform_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ if [ $# -eq 0 ]; then
usage # run usage function
fi

current="false"

while [ "$1" != "" ]; do
case $1 in
-g | --mgmt-resource-group-name)
Expand Down Expand Up @@ -111,18 +109,18 @@ do
if [[ $TF_LOG == "DEBUG" ]] ; then
az storage blob upload --file $tf_logfile \
--container-name "tflogs" \
--account-name $mgmt_storage_account_name \
--account-name "$mgmt_storage_account_name" \
--auth-mode key
fi

LOCKED_STATE=$(cat ${tf_logfile} | grep -c 'Error acquiring the state lock') || true;
TF_ERROR=$(cat ${tf_logfile} | grep -c 'COMMAND_EXIT_CODE="1"') || true;
if [[ $LOCKED_STATE > 0 ]];
if [[ $LOCKED_STATE -gt 0 ]];
then
RUN_COMMAND=1
echo "Error acquiring the state lock"
sleep 10
elif [[ $TF_ERROR > 0 ]];
elif [[ $TF_ERROR -gt 0 ]];
then
echo "Terraform Error"
exit 1
Expand Down

0 comments on commit 58e10e4

Please sign in to comment.