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