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