审查视图

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