作者 Administrator

更新 install.sh

#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n mmm-suplus-prd get pods | grep -q opp
kubectl -n mmm-suplus-prd get pods | grep -q mmm-oppmg
if [ "$?" == "1" ];then
kubectl create -f /tmp/prd/opp/opp.yaml --record
kubectl -n mmm-suplus-prd get svc | grep -q opp
kubectl create -f /tmp/prd/mmm-oppmg/mmm-oppmg.yaml --record
kubectl -n mmm-suplus-prd 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-prd get pods | grep -q opp
kubectl -n mmm-suplus-prd 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/prd/opp/opp.yaml
kubectl -n mmm-suplus-prd get svc | grep -q opp
kubectl delete -f /tmp/prd/mmm-oppmg/mmm-oppmg.yaml
kubectl -n mmm-suplus-prd get svc | grep -q mmm-oppmg
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-prd get svc | grep -q opp
kubectl -n mmm-suplus-prd get svc | grep -q mmm-oppmg
done
kubectl -n mmm-suplus-prd get pods | grep -q opp
kubectl -n mmm-suplus-prd get pods | grep -q mmm-oppmg
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-prd get pods | grep -q opp
kubectl -n mmm-suplus-prd get pods | grep -q mmm-oppmg
done
kubectl create -f /tmp/prd/opp/opp.yaml --record
kubectl -n mmm-suplus-prd get svc | grep -q opp
kubectl create -f /tmp/prd/mmm-oppmg/mmm-oppmg.yaml --record
kubectl -n mmm-suplus-prd 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-prd get pods | grep -q opp
kubectl -n mmm-suplus-prd 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
... ...