审查视图

deploy/k8s/dev/install.sh 1.6 KB
tangxuhui authored
1 2
#!/bin/bash
export PATH=/root/local/bin:$PATH
Administrator authored
3
kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-gateway
tangxuhui authored
4
if [ "$?" == "1" ];then
Administrator authored
5 6
	kubectl create -f /tmp/dev/allied-creation-gateway/allied-creation-gateway.yaml --record
	kubectl -n mmm-suplus-dev get svc | grep -q allied-creation-gateway
tangxuhui authored
7
	if [ "$?" == "0" ];then
Administrator authored
8
		echo "allied-creation-gateway service install success!"
tangxuhui authored
9
	else
Administrator authored
10
		echo "allied-creation-gateway service install fail!"
tangxuhui authored
11
	fi
Administrator authored
12
	kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-gateway
tangxuhui authored
13
	if [ "$?" == "0" ];then
Administrator authored
14
		echo "allied-creation-gateway deployment install success!"
tangxuhui authored
15
	else
Administrator authored
16
		echo "allied-creation-gateway deployment install fail!"
tangxuhui authored
17 18
	fi
else
Administrator authored
19 20
	kubectl delete -f /tmp/dev/allied-creation-gateway/allied-creation-gateway.yaml
	kubectl -n mmm-suplus-dev get svc | grep -q allied-creation-gateway
tangxuhui authored
21 22
	while [ "$?" == "0" ]
	do
Administrator authored
23
	kubectl -n mmm-suplus-dev get svc | grep -q allied-creation-gateway
tangxuhui authored
24
	done
Administrator authored
25
	kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-gateway
tangxuhui authored
26 27
	while [ "$?" == "0" ]
	do
Administrator authored
28
	kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-gateway
tangxuhui authored
29
	done
Administrator authored
30 31
	kubectl create -f /tmp/dev/allied-creation-gateway/allied-creation-gateway.yaml --record
	kubectl -n mmm-suplus-dev get svc | grep -q allied-creation-gateway
tangxuhui authored
32
	if [ "$?" == "0" ];then
Administrator authored
33
		echo "allied-creation-gateway service update success!"
tangxuhui authored
34
	else
Administrator authored
35
		echo "allied-creation-gateway service update fail!"
tangxuhui authored
36
	fi
Administrator authored
37
	kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-gateway
tangxuhui authored
38
	if [ "$?" == "0" ];then
Administrator authored
39
		echo "allied-creation-gateway deployment update success!"
tangxuhui authored
40
	else
Administrator authored
41
		echo "allied-creation-gateway deployment update fail!"
tangxuhui authored
42 43
	fi
fi