Add PONSim installation scripts
[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 CORD_CHART=${CORD_CHART:-${basepath}/../src_repo/seba_charts}
12
13 # TODO(alav): Make each step re-entrant
14
15 source util.sh
16
17 wait_for 10 'test $(kubectl get pods --all-namespaces | grep -ce "tiller.*Running") -eq 1'
18
19 # Add the CORD repository and update indexes
20
21 if [ "$(uname -m)" == "aarch64" ]; then
22   if [ ! -d ${CORD_CHART}/cord-platform ]; then
23     #git clone https://github.com/iecedge/seba_charts ${CORD_CHART}
24     cd ${basepath}/../src_repo && git submodule update --init seba_charts
25   fi
26 else
27   helm repo add cord "${CORD_REPO}"
28   helm repo update
29   CORD_CHART=cord
30 fi
31
32
33 # Install the CORD platform
34 helm install -n cord-platform ${CORD_CHART}/cord-platform --version="${CORD_PLATFORM_VERSION}"
35 # Wait until 3 etcd CRDs are present in Kubernetes
36 wait_for 300 'test $(kubectl get crd | grep -ice etcd) -eq 3' || true
37
38 # Install the SEBA profile
39 helm install -n seba --version "${SEBA_VERSION}" ${CORD_CHART}/seba
40 wait_for 500 'test $(kubectl get pods | grep -vcE "(\s(.+)/\2.*Running|tosca-loader.*Completed)") -eq 1' || true
41
42 # Install the AT&T workflow
43 helm install -n att-workflow --version "${ATT_WORKFLOW_VERSION}" ${CORD_CHART}/att-workflow
44 wait_for 300 'test $(kubectl get pods | grep -vcE "(\s(.+)/\2.*Running|tosca-loader.*Completed)") -eq 1' || true
45