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