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