作者 Administrator

更新 install.sh

#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n mmm-suplus-test get pods | grep -q sumifcc-discuss
kubectl -n mmm-suplus-prd get pods | grep -q sumicro-chat
if [ "$?" == "1" ];then
kubectl create -f /tmp/test/sumifcc-discuss/sumifcc-discuss.yaml --record
kubectl -n mmm-suplus-test get svc | grep -q sumifcc-discuss
kubectl create -f /tmp/prd/sumicro-chat/sumicro-chat.yaml --record
kubectl -n mmm-suplus-prd get svc | grep -q sumicro-chat
if [ "$?" == "0" ];then
echo "sumifcc-discuss service install success!"
echo "sumicro-chat service install success!"
else
echo "sumifcc-discuss service install fail!"
echo "sumicro-chat service install fail!"
fi
kubectl -n mmm-suplus-test get pods | grep -q sumifcc-discuss
kubectl -n mmm-suplus-prd get pods | grep -q sumicro-chat
if [ "$?" == "0" ];then
echo "sumifcc-discuss deployment install success!"
echo "sumicro-chat deployment install success!"
else
echo "sumifcc-discuss deployment install fail!"
echo "sumicro-chat deployment install fail!"
fi
else
kubectl delete -f /tmp/test/sumifcc-discuss/sumifcc-discuss.yaml
kubectl -n mmm-suplus-test get svc | grep -q sumifcc-discuss
kubectl delete -f /tmp/prd/sumicro-chat/sumicro-chat.yaml
kubectl -n mmm-suplus-prd get svc | grep -q sumicro-chat
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-test get svc | grep -q sumifcc-discuss
kubectl -n mmm-suplus-prd get svc | grep -q sumicro-chat
done
kubectl -n mmm-suplus-test get pods | grep -q sumifcc-discuss
kubectl -n mmm-suplus-prd get pods | grep -q sumicro-chat
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-test get pods | grep -q sumifcc-discuss
kubectl -n mmm-suplus-prd get pods | grep -q sumicro-chat
done
kubectl create -f /tmp/test/sumifcc-discuss/sumifcc-discuss.yaml --record
kubectl -n mmm-suplus-test get svc | grep -q sumifcc-discuss
kubectl create -f /tmp/prd/sumicro-chat/sumicro-chat.yaml --record
kubectl -n mmm-suplus-prd get svc | grep -q sumicro-chat
if [ "$?" == "0" ];then
echo "sumifcc-discuss service update success!"
echo "sumicro-chat service update success!"
else
echo "sumifcc-discuss service update fail!"
echo "sumicro-chat service update fail!"
fi
kubectl -n mmm-suplus-test get pods | grep -q sumifcc-discuss
kubectl -n mmm-suplus-prd get pods | grep -q sumicro-chat
if [ "$?" == "0" ];then
echo "sumifcc-discuss deployment update success!"
echo "sumicro-chat deployment update success!"
else
echo "sumifcc-discuss deployment update fail!"
echo "sumicro-chat deployment update fail!"
fi
fi
\ No newline at end of file
... ...