Merge pull request #23 from Heavybullets8/wait-for-deploying

-Do not update until application is no longer deploying
This commit is contained in:
Heavybullets8 2022-09-04 23:30:14 +00:00 committed by GitHub
commit a5fcf2f81a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,6 +96,21 @@ if ! grep -qs "^$app_name," external_services ; then
fi
fi
# If application is deploying prior to updating, attempt to wait for it to finish
if [[ "$startstatus" == "DEPLOYING" ]]; then
SECONDS=0
while [[ "$status" == "DEPLOYING" ]]
do
status=$(grep "^$app_name," all_app_status | awk -F ',' '{print $2}')
if [[ "$SECONDS" -ge "$timeout" ]]; then
echo_array+=("Application is stuck Deploying, Skipping to avoid damage")
echo_array
return
fi
sleep 5
done
fi
# If user is using -S, stop app prior to updating
echo_array+=("\n$app_name")
if [[ $stop_before_update == "true" && "$startstatus" != "STOPPED" ]]; then # Check to see if user is using -S or not