NONRTRIC - Selection of which components to include
Making it possible to freely include or exclude each component.
Simplified the install and unistall scripts some.
Change-Id: I708f5adcdb410f768af3218994919c2079b79ab3
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Issue-ID: NONRTRIC-478
diff --git a/bin/deploy-nonrtric b/bin/deploy-nonrtric
index 887c04e..0643f4b 100755
--- a/bin/deploy-nonrtric
+++ b/bin/deploy-nonrtric
@@ -125,4 +125,29 @@
echo "Finished Packaging NONRTRIC components [$COMPONENTS]"
-$ROOT_DIR/../nonrtric/bin/install -f $OVERRIDEYAML
+
+COMMON_BLOCK=$(cat $OVERRIDEYAML | awk '/^common:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^ namespace:/{getline; while ($0 ~ /^ .*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NONRTRIC_NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *nonrtric:/{print $2}')
+RELEASE_PREFIX=$(echo "$COMMON_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
+
+if ! kubectl get ns ${NONRTRIC_NAMESPACE:-nonrtric}> /dev/null 2>&1; then
+ kubectl create ns ${NONRTRIC_NAMESPACE:-nonrtric}
+fi
+if ! kubectl get ns onap > /dev/null 2>&1; then
+ kubectl create ns onap
+fi
+
+kubectl create configmap -n ${NONRTRIC_NAMESPACE:-nonrtric} nonrtric-recipe --from-file=recipe=$OVERRIDEYAML
+
+echo "Deploying NONRTRIC"
+
+HELM_NAME_OPT=""
+if [ -z $IS_HELM3 ];then
+ HELM_NAME_OPT="--name"
+fi
+
+echo "helm install -f $OVERRIDEYAML --namespace ${NONRTRIC_NAMESPACE:-nonrtric} ${HELM_NAME_OPT} ${RELEASE_PREFIX} $ROOT_DIR/../nonrtric/helm/nonrtric"
+helm install -f $OVERRIDEYAML --namespace "${NONRTRIC_NAMESPACE:-nonrtric}" ${HELM_NAME_OPT} "${RELEASE_PREFIX}" "$ROOT_DIR/../nonrtric/helm/nonrtric"
+
+