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