github.com/oam-dev/kubevela@v1.9.11/hack/utils/installdefinition.sh (about)

     1  #! /bin/bash
     2  DEF_PATH="charts/vela-core/templates/defwithtemplate"
     3  
     4  function check_install() {
     5    res=`kubectl get namespace -A | grep vela-system`
     6    if [ -n "$res" ];then
     7      echo 'checking: vela-system namespace exist'
     8    else
     9      echo 'vela-system namespace do not exist'
    10      echo 'creating vela-system namespace ...'
    11      kubectl create namespace vela-system
    12    fi
    13    echo "applying definitions ..."
    14    cd "$DEF_PATH"
    15  
    16    for file in *.yaml ;
    17      do
    18        echo "Info: changing "$DEF_PATH"/""$file"
    19        sed -i.bak "s#namespace: {{ include \"systemDefinitionNamespace\" . }}#namespace: vela-system#g" "$file"
    20        kubectl apply -f "$file"
    21        rm "$file"
    22        mv "$file"".bak" "$file"
    23      done
    24  
    25    cd -
    26  }
    27  
    28  check_install
    29  
    30  DEF_PATH="charts/vela-core/templates/definitions"
    31  
    32  check_install
    33  
    34  DEF_PATH="charts/vela-core/templates/velaql"
    35  
    36  check_install