remove echo

This commit is contained in:
Heavybullets8 2022-07-25 17:06:59 -06:00
parent 337c6faa9e
commit 25236e8b15

View File

@ -48,38 +48,38 @@ printf '%s\0' "${ignore[@]}" | grep -iFxqz "${app_name}" && echo -e "\n$app_name
if [[ "$diff_app" == "$diff_chart" || "$update_all_apps" == "true" ]]; then #continue to update if [[ "$diff_app" == "$diff_chart" || "$update_all_apps" == "true" ]]; then #continue to update
if [[ $stop_before_update == "true" ]]; then # Check to see if user is using -S or not if [[ $stop_before_update == "true" ]]; then # Check to see if user is using -S or not
if [[ "$status" == "STOPPED" ]]; then # if status is already stopped, skip while loop if [[ "$status" == "STOPPED" ]]; then # if status is already stopped, skip while loop
echo_array+=(echo -e "\n$app_name") echo_array+=("\n$app_name")
[[ "$verbose" == "true" ]] && echo_array+=(echo "Updating..") [[ "$verbose" == "true" ]] && echo_array+=("Updating..")
cli -c 'app chart_release upgrade release_name=''"'"$app_name"'"' &> /dev/null && echo_array+=(echo -e "Updated\n$old_full_ver\n$new_full_ver") && after_update_actions || echo_array+=(echo "FAILED") cli -c 'app chart_release upgrade release_name=''"'"$app_name"'"' &> /dev/null && echo_array+=("Updated\n$old_full_ver\n$new_full_ver") && after_update_actions || echo_array+=("FAILED")
return return
else # if status was not STOPPED, stop the app prior to updating else # if status was not STOPPED, stop the app prior to updating
echo_array+=(echo -e "\n$app_name") echo_array+=("\n$app_name")
[[ "$verbose" == "true" ]] && echo_array+=(echo "Stopping prior to update..") [[ "$verbose" == "true" ]] && echo_array+=("Stopping prior to update..")
midclt call chart.release.scale "$app_name" '{"replica_count": 0}' &> /dev/null && SECONDS=0 || echo_array+=(echo -e "FAILED") midclt call chart.release.scale "$app_name" '{"replica_count": 0}' &> /dev/null && SECONDS=0 || echo_array+=("FAILED")
while [[ "$status" != "STOPPED" ]] while [[ "$status" != "STOPPED" ]]
do do
status=$(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,status' | grep "^$app_name," | awk -F ',' '{print $2}') status=$(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,status' | grep "^$app_name," | awk -F ',' '{print $2}')
if [[ "$status" == "STOPPED" ]]; then if [[ "$status" == "STOPPED" ]]; then
echo_array+=(echo "Stopped") echo_array+=("Stopped")
[[ "$verbose" == "true" ]] && echo_array+=(echo "Updating..") [[ "$verbose" == "true" ]] && echo_array+=("Updating..")
cli -c 'app chart_release upgrade release_name=''"'"$app_name"'"' &> /dev/null && echo_array+=(echo -e "Updated\n$old_full_ver\n$new_full_ver") && after_update_actions || echo "Failed to update" cli -c 'app chart_release upgrade release_name=''"'"$app_name"'"' &> /dev/null && echo_array+=("Updated\n$old_full_ver\n$new_full_ver") && after_update_actions || echo "Failed to update"
break break
elif [[ "$SECONDS" -ge "$timeout" ]]; then elif [[ "$SECONDS" -ge "$timeout" ]]; then
echo_array+=(echo "Error: Run Time($SECONDS) has exceeded Timeout($timeout)") echo_array+=("Error: Run Time($SECONDS) has exceeded Timeout($timeout)")
break break
elif [[ "$status" != "STOPPED" ]]; then elif [[ "$status" != "STOPPED" ]]; then
[[ "$verbose" == "true" ]] && echo_array+=(echo "Waiting $((timeout-SECONDS)) more seconds for $app_name to be STOPPED") [[ "$verbose" == "true" ]] && echo_array+=("Waiting $((timeout-SECONDS)) more seconds for $app_name to be STOPPED")
sleep 10 sleep 10
fi fi
done done
fi fi
else #user must not be using -S, just update else #user must not be using -S, just update
echo_array+=(echo -e "\n$app_name") echo_array+=("\n$app_name")
[[ "$verbose" == "true" ]] && echo_array+=(echo "Updating..") [[ "$verbose" == "true" ]] && echo_array+=("Updating..")
cli -c 'app chart_release upgrade release_name=''"'"$app_name"'"' &> /dev/null && echo_array+=(echo -e "Updated\n$old_full_ver\n$new_full_ver") && after_update_actions || echo "FAILED" cli -c 'app chart_release upgrade release_name=''"'"$app_name"'"' &> /dev/null && echo_array+=("Updated\n$old_full_ver\n$new_full_ver") && after_update_actions || echo "FAILED"
fi fi
else else
echo_array+=(echo -e "\n$app_name\nMajor Release, update manually") echo_array+=("\n$app_name\nMajor Release, update manually")
return return
fi fi