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