Merge "Add uninstall and test scripts for SEBA"
[iec.git] / src / use_cases / seba_on_arm / install / install.sh
1 #!/bin/bash -ex
2 # shellcheck disable=SC2016
3
4 #Modified from https://github.com/cachengo/seba_charts/blob/master/scripts/installSEBA.sh
5
6 basepath=$(cd "$(dirname "$0")"; pwd)
7 CORD_REPO=${CORD_REPO:-https://charts.opencord.org}
8 CORD_PLATFORM_VERSION=${CORD_PLATFORM_VERSION:-6.1.0}
9 SEBA_VERSION=${SEBA_VERSION:-1.0.0}
10 ATT_WORKFLOW_VERSION=${ATT_WORKFLOW_VERSION:-1.0.2}
11 BBSIM_VERSION=${SEBA_VERSION:-1.0.0}
12
13 CORD_CHART=${CORD_CHART:-${basepath}/../src_repo/seba_charts}
14
15 # TODO(alav): Make each step re-entrant
16
17 source util.sh
18
19 wait_for 10 'test $(kubectl get pods --all-namespaces | grep -ce "tiller.*Running") -eq 1'
20
21 # Add the CORD repository and update indexes
22
23 if [ "$(uname -m)" == "aarch64" ]; then
24   if [ ! -d ${CORD_CHART}/cord-platform ]; then
25     #git clone https://github.com/iecedge/seba_charts ${CORD_CHART}
26     cd ${basepath}/../src_repo && git submodule update --init seba_charts
27   fi
28 else
29   helm repo add cord "${CORD_REPO}"
30   helm repo update
31   CORD_CHART=cord
32 fi
33
34
35 # Install the CORD platform
36 helm install -n cord-platform ${CORD_CHART}/cord-platform --version="${CORD_PLATFORM_VERSION}"
37 # Wait until 3 etcd CRDs are present in Kubernetes
38 wait_for 300 'test $(kubectl get crd | grep -ice etcd) -eq 3' || true
39
40 # Install the SEBA profile
41 helm install -n seba --version "${SEBA_VERSION}" ${CORD_CHART}/seba
42 wait_for 500 'test $(kubectl get pods | grep -vcE "(\s(.+)/\2.*Running|tosca-loader.*Completed)") -eq 1' || true
43
44 # Install the AT&T workflow
45 helm install -n att-workflow --version "${ATT_WORKFLOW_VERSION}" ${CORD_CHART}/att-workflow
46 wait_for 300 'test $(kubectl get pods | grep -vcE "(\s(.+)/\2.*Running|tosca-loader.*Completed)") -eq 1' || true
47
48 # Install bbsim
49 export BBSIM_VERSION
50 #helm install -n bbsim --version ${BBSIM_VERSION} ${CORD_CHART}/bbsim