Skip to content

Commit

Permalink
Update argocd_application_upgrade_azure.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Asraf-Khan-ML authored Oct 16, 2023
1 parent 0f0d3cf commit bf9e28a
Showing 1 changed file with 9 additions and 33 deletions.
42 changes: 9 additions & 33 deletions charts/argocd/argocd_application_upgrade_azure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,17 @@ fi
###command to get ArgoCD server LoadBalancer IP
argocdserver=$(kubectl get svc argocd-server -n argocd | awk NR==2'{print $4}')



###ArgoCD login via CLI
/usr/bin/expect <(cat << EOF
spawn argocd login $argocdserver
expect "WARNING:*"
send "y\r"
expect "Username:"
send "admin\r"
expect "Password:"
send "admin@123\r"
expect "*successfully"
interact
EOF
) >> upgrade.log
argocd login $argocdserver --username admin --password admin@123 --insecure

### Upgrade All application if argument is All
if [[ $# -eq 1 && "$1" == "All" ]]
then
echo -e "\nUpgrading below applications: "
echo -e "\n${app_list[@]}"
echo $(date -u) " Upgrade started" >> upgrade.log
/usr/bin/expect <(cat << EOF
spawn argocd app sync $app_list1 --timeout 4800 --prune
expect "*successfully synced*"
sleep 10
interact
EOF
) >> upgrade.log

echo -e "\nUpgrading below applications: "
echo -e "\n${app_list[@]}"
echo $(date -u) " Upgrade started" >> upgrade.log
argocd app sync $app_list1 --timeout 4800 --prune --retry-limit 3 >> upgrade.log
sleep 10

### Upgrade specific Application provided as arguments
elif [[ $# -ne 0 && "$1" != "All" ]]
Expand All @@ -104,13 +85,8 @@ then
then
echo -e "\nUpgrading Application(s) - $@ "
echo $(date -u) " Upgrade started" >> upgrade.log
/usr/bin/expect <(cat << EOF
spawn argocd app sync $* --timeout 4800 --prune
expect "*successfully synced*"
sleep 10
interact
EOF
) >> upgrade.log
argocd app sync $* --timeout 4800 --prune --retry-limit 3 >> upgrade.log
sleep 10

fi
fi
Expand Down Expand Up @@ -158,4 +134,4 @@ else
fi

#Update ArgoCD service with NodePort
kubectl patch svc argocd-server -n argocd -p '{"spec":{"type":"NodePort"}}' >> upgrade.log
kubectl patch svc argocd-server -n argocd -p '{"spec":{"type":"NodePort"}}' >> upgrade.log

0 comments on commit bf9e28a

Please sign in to comment.