作者 Administrator
提交者 yangfu

更新 install.sh

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