作者 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-system
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-system/sumicro-system.yaml --record
kubectl -n mmm-suplus-prd get svc | grep -q sumicro-system
if [ "$?" == "0" ];then
echo "sumifcc-discuss service install success!"
echo "sumicro-system service install success!"
else
echo "sumifcc-discuss service install fail!"
echo "sumicro-system 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-system
if [ "$?" == "0" ];then
echo "sumifcc-discuss deployment install success!"
echo "sumicro-system deployment install success!"
else
echo "sumifcc-discuss deployment install fail!"
echo "sumicro-system 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-system/sumicro-system.yaml
kubectl -n mmm-suplus-prd get svc | grep -q sumicro-system
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-test get svc | grep -q sumifcc-discuss
kubectl -n mmm-suplus-prd get svc | grep -q sumicro-system
done
kubectl -n mmm-suplus-test get pods | grep -q sumifcc-discuss
kubectl -n mmm-suplus-prd get pods | grep -q sumicro-system
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-test get pods | grep -q sumifcc-discuss
kubectl -n mmm-suplus-prd get pods | grep -q sumicro-system
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-system/sumicro-system.yaml --record
kubectl -n mmm-suplus-prd get svc | grep -q sumicro-system
if [ "$?" == "0" ];then
echo "sumifcc-discuss service update success!"
echo "sumicro-system service update success!"
else
echo "sumifcc-discuss service update fail!"
echo "sumicro-system 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-system
if [ "$?" == "0" ];then
echo "sumifcc-discuss deployment update success!"
echo "sumicro-system deployment update success!"
else
echo "sumifcc-discuss deployment update fail!"
echo "sumicro-system deployment update fail!"
fi
fi
\ No newline at end of file
... ...