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