From 67c2f39f869c5ee83bf7c1a69de1c4070270a578 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Sat, 13 Aug 2022 15:07:06 -0600 Subject: [PATCH] test deploying file --- functions/update_apps.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/functions/update_apps.sh b/functions/update_apps.sh index c977978f..ae65f945 100644 --- a/functions/update_apps.sh +++ b/functions/update_apps.sh @@ -17,6 +17,15 @@ do if while_status=$(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,status' 2>/dev/null) ; then ((while_count++)) [[ -z $while_status ]] && continue || echo -e "$while_count\n$while_status" > temp.txt + for i in "${while_status[@]}" + do + app_name=$(echo "$i" | awk -F ',' '{print $1}') + status=$(echo "$i" | awk -F ',' '{print $2}') + if [[ $status == "DEPLOYING" ]]; then + [[ ! -e deploying ]] && touch deploying + grep -qs "$app_name,DEPLOYING" deploying || echo "$app_name,DEPLOYING" >> deploying + fi + done else echo "Middlewared timed out. Consider setting a lower number for async applications" continue @@ -46,6 +55,7 @@ do fi done rm temp.txt +rm deploying echo echo @@ -176,8 +186,8 @@ count=0 if [[ $rollback == "true" || "$startstatus" == "STOPPED" ]]; then while true do - status=$( grep "^$app_name," temp.txt | awk -F ',' '{print $2}') - if [[ $count -lt 1 && $status != "DEPLOYING" ]]; then # If status shows up as Active or Stopped on the first check, verify that. Otherwise it may be a false report.. + status=$(grep "^$app_name," temp.txt | awk -F ',' '{print $2}') + if [[ $count -lt 1 && $status != "DEPLOYING" && "$(grep "^$app_name," deploying | awk -F ',' '{print $2}')" != "DEPLOYING" ]]; then # If status shows up as Active or Stopped on the first check, verify that. Otherwise it may be a false report.. [[ "$verbose" == "true" ]] && echo_array+=("Verifying $status..") old_status=$status before_loop=$(head -n 1 temp.txt)