get the version number from config.json instead of hard coding it
[it/test.git] / XTesting / xapp / deploy.sh
1 #!/bin/bash
2 set -x
3
4 #install pip3
5 apt install python3-pip -y
6
7 #install helm3
8 export HELM_VERSION=3.5.4
9
10 # Install helm (to the specific release)
11 # ENV BASE_URL="https://storage.googleapis.com/kubernetes-helm"
12 export BASE_URL="https://get.helm.sh"
13 export TAR_FILE="helm-v${HELM_VERSION}-linux-amd64.tar.gz"
14     curl -sL ${BASE_URL}/${TAR_FILE} | tar -xvz && \
15     mv linux-amd64/helm /usr/bin/helm && \
16     chmod +x /usr/bin/helm && \
17     rm -rf linux-amd64
18
19 # add helm-diff
20 helm plugin install https://github.com/databus23/helm-diff && rm -rf /tmp/helm-*
21
22 # add helm-unittest
23 helm plugin install https://github.com/quintush/helm-unittest && rm -rf /tmp/helm-*
24
25 # add helm-push
26 helm plugin install https://github.com/chartmuseum/helm-push && rm -rf /tmp/helm-*
27
28 # Install jq
29 apt install jq -y
30
31 # pull xapp_onboarder code
32 git clone "https://gerrit.o-ran-sc.org/r/ric-plt/appmgr"
33 cd appmgr/xapp_orchestrater/dev/xapp_onboarder
34
35 #update the requirement for the package "six" otherwise it might conflict with some other dependencies
36 cat requirements.txt | sed -e '/six/d' > /tmp/1
37 echo "six>=1.14.0" >> /tmp/1
38 cp /tmp/1 requirements.txt
39
40 # install xapp_onboarder
41 pip3 uninstall xapp_onboarder
42 pip3 install ./
43
44 #Create a local helm repository with a port other than 8080 on host
45 docker run --rm -u 0 -it -d -p 8090:8080 -e DEBUG=1 -e STORAGE=local -e STORAGE_LOCAL_ROOTDIR=/charts -v $(pwd)/charts:/charts chartmuseum/chartmuseum:latest
46 export CHART_REPO_URL=http://0.0.0.0:8090
47
48 cd ../../../..
49
50 # use dms_cli to install the kpimon-go xApp
51 git clone "https://gerrit.o-ran-sc.org/r/ric-app/kpimon-go"
52 cd kpimon-go/deploy/
53 export XAPP_VERSION=`grep version config.json | cut -f2 -d: | cut -f2 -d\"`
54 dms_cli onboard config.json schema.json
55 dms_cli install kpimon-go ${XAPP_VERSION} ricxapp