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