new method of deploying check

This commit is contained in:
Heavybullets8 2022-08-13 15:26:50 -06:00
parent e1e7c52953
commit 978bf40d5a

View File

@ -14,16 +14,16 @@ it=0
while_count=0 while_count=0
while true while true
do do
if mapfile -t while_status < <(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,status' 2>/dev/null) ; then 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++)) ((while_count++))
[[ -z ${while_status[*]} ]] && continue || echo -e "$while_count\n${while_status[*]}" > temp.txt [[ -z $while_status ]] && continue || echo -e "$while_count\n$while_status" > temp.txt
for i in "${while_status[@]}" mapfile -t deploying_check < <(grep ",DEPLOYING," temp.txt)
for i in "${deploying_check[@]}"
do do
app_name=$(echo "$i" | awk -F ',' '{print $1}') app_name=$(echo "$i" | awk -F ',' '{print $1}')
status=$(echo "$i" | awk -F ',' '{print $2}') [[ ! -e deploying ]] && touch deploying
if [[ $status == "DEPLOYING" ]]; then if ! grep -qs "$app_name,DEPLOYING" deploying; then
[[ ! -e deploying ]] && touch deploying echo "$app_name,DEPLOYING" >> deploying
grep -qs "$app_name,DEPLOYING" deploying || echo "$app_name,DEPLOYING" >> deploying
fi fi
done done
else else