作者 Administrator

更新 install.sh

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