作者 Administrator

更新 install.sh

#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n mmm-suplus-dev get pods | grep -q partner
kubectl -n mmm-suplus-dev get pods | grep -q partnermg
if [ "$?" == "1" ];then
kubectl create -f /tmp/dev/partner/partner.yaml --record
kubectl -n mmm-suplus-dev get svc | grep -q partner
kubectl create -f /tmp/dev/partnermgmg/partnermg.yaml --record
kubectl -n mmm-suplus-dev get svc | grep -q partnermg
if [ "$?" == "0" ];then
echo "partner service install success!"
else
echo "partner service install fail!"
fi
kubectl -n mmm-suplus-dev get pods | grep -q partner
kubectl -n mmm-suplus-dev get pods | grep -q partnermg
if [ "$?" == "0" ];then
echo "partner deployment install success!"
else
echo "partner deployment install fail!"
fi
else
kubectl delete -f /tmp/dev/partner/partner.yaml
kubectl -n mmm-suplus-dev get svc | grep -q partner
kubectl delete -f /tmp/dev/partnermg/partnermg.yaml
kubectl -n mmm-suplus-dev get svc | grep -q partnermg
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-dev get svc | grep -q partner
kubectl -n mmm-suplus-dev get svc | grep -q partnermg
done
kubectl -n mmm-suplus-dev get pods | grep -q partner
kubectl -n mmm-suplus-dev get pods | grep -q partnermg
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-dev get pods | grep -q partner
kubectl -n mmm-suplus-dev get pods | grep -q partnermg
done
kubectl create -f /tmp/dev/partner/partner.yaml --record
kubectl -n mmm-suplus-dev get svc | grep -q partner
kubectl create -f /tmp/dev/partnermg/partnermg.yaml --record
kubectl -n mmm-suplus-dev get svc | grep -q partnermg
if [ "$?" == "0" ];then
echo "partner service update success!"
else
echo "partner service update fail!"
fi
kubectl -n mmm-suplus-dev get pods | grep -q partner
kubectl -n mmm-suplus-dev get pods | grep -q partnermg
if [ "$?" == "0" ];then
echo "partner deployment update success!"
else
... ...