作者 Administrator

更新 install.sh

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