作者 Administrator

更新 install.sh

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