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