|
|
#!/bin/bash
|
|
|
export PATH=/root/local/bin:$PATH
|
|
|
kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
|
|
|
kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-user
|
|
|
if [ "$?" == "1" ];then
|
|
|
kubectl create -f /tmp/dev/project/project.yaml --record
|
|
|
kubectl -n <replace-your-k8s-namespace> get svc | grep -q project
|
|
|
kubectl create -f /tmp/dev/allied-creation-user/allied-creation-user.yaml --record
|
|
|
kubectl -n mmm-suplus-dev get svc | grep -q allied-creation-user
|
|
|
if [ "$?" == "0" ];then
|
|
|
echo "project service install success!"
|
|
|
echo "allied-creation-user service install success!"
|
|
|
else
|
|
|
echo "project service install fail!"
|
|
|
echo "allied-creation-user service install fail!"
|
|
|
fi
|
|
|
kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
|
|
|
kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-user
|
|
|
if [ "$?" == "0" ];then
|
|
|
echo "project deployment install success!"
|
|
|
echo "allied-creation-user deployment install success!"
|
|
|
else
|
|
|
echo "project deployment install fail!"
|
|
|
echo "allied-creation-user deployment install fail!"
|
|
|
fi
|
|
|
else
|
|
|
kubectl delete -f /tmp/dev/project/project.yaml
|
|
|
kubectl -n <replace-your-k8s-namespace> get svc | grep -q project
|
|
|
kubectl delete -f /tmp/dev/allied-creation-user/allied-creation-user.yaml
|
|
|
kubectl -n mmm-suplus-dev get svc | grep -q allied-creation-user
|
|
|
while [ "$?" == "0" ]
|
|
|
do
|
|
|
kubectl -n <replace-your-k8s-namespace> get svc | grep -q project
|
|
|
kubectl -n mmm-suplus-dev get svc | grep -q allied-creation-user
|
|
|
done
|
|
|
kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
|
|
|
kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-user
|
|
|
while [ "$?" == "0" ]
|
|
|
do
|
|
|
kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
|
|
|
kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-user
|
|
|
done
|
|
|
kubectl create -f /tmp/dev/project/project.yaml --record
|
|
|
kubectl -n <replace-your-k8s-namespace> get svc | grep -q project
|
|
|
kubectl create -f /tmp/dev/allied-creation-user/allied-creation-user.yaml --record
|
|
|
kubectl -n mmm-suplus-dev get svc | grep -q allied-creation-user
|
|
|
if [ "$?" == "0" ];then
|
|
|
echo "project service update success!"
|
|
|
echo "allied-creation-user service update success!"
|
|
|
else
|
|
|
echo "project service update fail!"
|
|
|
echo "allied-creation-user service update fail!"
|
|
|
fi
|
|
|
kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
|
|
|
kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-user
|
|
|
if [ "$?" == "0" ];then
|
|
|
echo "project deployment update success!"
|
|
|
echo "allied-creation-user deployment update success!"
|
|
|
else
|
|
|
echo "project deployment update fail!"
|
|
|
echo "allied-creation-user deployment update fail!"
|
|
|
fi
|
|
|
fi |
|
|
\ No newline at end of file |
...
|
...
|
|