aravind.est | 98d1f7b | 2024-06-24 17:01:47 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ============LICENSE_START======================================================= |
| 3 | # Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved. |
| 4 | # ================================================================================ |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # ============LICENSE_END============================================ |
| 17 | # |
| 18 | |
| 19 | ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" |
| 20 | CM_VERSION="v0.16.1" |
| 21 | CM_PORT="8879" |
| 22 | HELM_LOCAL_REPO="$ROOT_DIR/chartstorage" |
| 23 | |
| 24 | echo "Installing ChartMuseum binary..." |
| 25 | pushd /tmp |
| 26 | wget https://get.helm.sh/chartmuseum-$CM_VERSION-linux-amd64.tar.gz |
| 27 | tar xvfz chartmuseum-$CM_VERSION-linux-amd64.tar.gz |
| 28 | sudo mv /tmp/linux-amd64/chartmuseum /usr/local/bin/chartmuseum |
| 29 | popd |
| 30 | |
| 31 | echo "Starting ChartMuseum on port $CM_PORT..." |
| 32 | nohup chartmuseum --port=$CM_PORT --storage="local" --storage-local-rootdir=$HELM_LOCAL_REPO >/dev/null 2>&1 & |
| 33 | echo $! > $ROOT_DIR/CM_PID.txt |
| 34 | |
| 35 | wget https://get.helm.sh/helm-v3.12.3-linux-amd64.tar.gz |
| 36 | tar xvfz /tmp/helm-v3.12.3-linux-amd64.tar.gz |
| 37 | sudo mv linux-amd64/helm /usr/local/bin/helm |
| 38 | |
| 39 | TAR_VERSION=v0.10.3 |
| 40 | echo "Downloading and installing helm-push ${TAR_VERSION} ..." |
| 41 | TAR_FILE=helm-push-${TAR_VERSION}.tar.gz |
| 42 | HELM_PLUGINS=$(helm env HELM_PLUGINS) |
| 43 | mkdir -p $HELM_PLUGINS/helm-push |
| 44 | cd $HELM_PLUGINS/helm-push |
| 45 | wget https://nexus.o-ran-sc.org/content/repositories/thirdparty/chartmuseum/helm-push/$TAR_VERSION/$TAR_FILE |
| 46 | tar zxvf $TAR_FILE >/dev/null |
| 47 | rm $TAR_FILE |
| 48 | helm repo remove local |
| 49 | helm repo add local http://localhost:8879 |
| 50 | popd |
| 51 | |
| 52 | sudo apt-get install make -y |
| 53 | (cd smo && make all) |
| 54 | |
| 55 | # Creating namespace |
| 56 | kubectl create ns smo |
| 57 | |
| 58 | # Installing helm charts |
| 59 | helm install --debug oran-smo local/smo --namespace smo |
| 60 | |
| 61 | # Show the installed pods |
| 62 | kubectl get po -n smo |