From 68f8934708c5b47a784a54abb156d6103dda70ed Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Mon, 8 Aug 2022 23:47:34 -0600 Subject: [PATCH] test trigger --- functions/update_apps.sh | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/functions/update_apps.sh b/functions/update_apps.sh index b278a31e..d5ab9391 100644 --- a/functions/update_apps.sh +++ b/functions/update_apps.sh @@ -12,18 +12,23 @@ echo "Asynchronous Updates: $update_limit" # previous 20% 2 min 9 seconds it=0 first_run=0 +while_status=$(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,status' 2>/dev/null) while true do - while true - 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 - echo "Middlewared timed out, consider lowering your async updates" - sleep 5 - else - echo "$while_status" > temp.txt - break - fi - done + # while true + # 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 + # echo "Middlewared timed out, consider lowering your async updates" + # sleep 5 + # else + # echo "$while_status" > temp.txt + # break + # fi + # done + if [ ! -e "$file" ] ; then + while_status=$(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,status' 2>/dev/null) + echo "$while_status" > temp.txt + fi proc_count=${#processes[@]} count=0 for proc in "${processes[@]}" @@ -101,6 +106,7 @@ if [[ "$diff_app" == "$diff_chart" || "$update_all_apps" == "true" ]]; then #con [[ "$verbose" == "true" ]] && echo_array+=("Stopping prior to update..") midclt call chart.release.scale "$app_name" '{"replica_count": 0}' &> /dev/null || echo_array+=("Error: Failed to stop $app_name") SECONDS=0 + [[ ! -e trigger ]] && touch trigger while [[ "$status" != "STOPPED" ]] do status=$( grep "^$app_name," temp.txt | awk -F ',' '{print $2}') @@ -135,6 +141,7 @@ export -f update_apps after_update_actions(){ SECONDS=0 count=0 +[[ ! -e trigger ]] && touch trigger if [[ $rollback == "true" || "$startstatus" == "STOPPED" ]]; then while true do