作者 Administrator

增加新文件

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