helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/nonrtric-common
curl --data-binary @/tmp/nonrtric-common-$NONRTRIC_COMMON_CHART_VERSION.tgz $CM_CHART_POST_URL
-COMPONENTS="controlpanel a1controller a1simulator policymanagementservice informationservice rappcatalogueservice rappcatalogueenhancedservice nonrtricgateway dmaapadapterservice dmaapmediatorservice helmmanager orufhrecovery ransliceassurance capifcore rappmanager dmeparticipant"
+charts_already_exists=()
+
+COMPONENTS="
+a1controller \
+a1simulator \
+capifcore \
+controlpanel \
+dmaapadapterservice \
+dmaapmediatorservice \
+dmeparticipant \
+helmmanager \
+informationservice \
+nonrtricgateway \
+orufhrecovery \
+policymanagementservice \
+ransliceassurance \
+rappcatalogueenhancedservice \
+rappcatalogueservice \
+rappmanager \
+servicemanager \
+"
+
for component in $COMPONENTS; do
echo "Packaging NONRTRIC component [$component]"
helm dep up $ROOT_DIR/../nonrtric/helm/$component
VERSION=$(cat $ROOT_DIR/../nonrtric/helm/$component/Chart.yaml | grep version | awk '{print $2}')
helm package -d /tmp $ROOT_DIR/../nonrtric/helm/$component
- curl --data-binary @/tmp/$component-$VERSION.tgz $CM_CHART_POST_URL
+ resp_code=$(curl -s -o /dev/null -w "%{http_code}" --data-binary @/tmp/$component-$VERSION.tgz $CM_CHART_POST_URL)
+ echo "Chart upload status of $component is $resp_code"
+ if [ "$resp_code" -eq 409 ]; then
+ charts_already_exists+=("$component")
+ fi
done
+if [ ${#charts_already_exists[@]} -gt 0 ]; then
+ echo "----------------------------------- WARNING!!! -------------------------------------------"
+ echo "The following charts already exists in ChartMuseum '${charts_already_exists[@]}'."
+ echo "The current build of the charts hasn't been updated because the charts already exist."
+ echo "It is recommended to delete the charts from ChartMuseum before the build."
+ echo "------------------------------------------------------------------------------------------"
+fi
+
helm dep up $ROOT_DIR/../nonrtric/helm/nonrtric
helm repo index ${HELM_LOCAL_REPO}
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
+HELM_NAME_OPT=""
+if [ -z $IS_HELM3 ];then
+ HELM_NAME_OPT="--name"
+fi
+
echo "Install Kong- $INSTALL_KONG"
if [ "$INSTALL_KONG" = true ];then
- echo "Installing Kong"
- helm repo add kong https://charts.konghq.com --force-update
- helm repo update
- helm install kong-nonrtric --namespace ${NONRTRIC_NAMESPACE:-nonrtric} kong/kong --set ingressController.installCRDs=false --set admin.enabled=true
+ echo "Install kongstorage through helm"
+ helm install kongstorage -n "${NONRTRIC_NAMESPACE:-nonrtric}" ${HELM_NAME_OPT} "$ROOT_DIR/../nonrtric/helm/kongstorage"
+
+ echo "Installing Kong"
+ helm repo add kong https://charts.konghq.com --force-update
+ helm repo update
+ helm install kong-nonrtric kong/kong -n ${NONRTRIC_NAMESPACE:-nonrtric} -f dep/nonrtric/helm/kongstorage/kongvalues.yaml
fi
kubectl create configmap -n ${NONRTRIC_NAMESPACE:-nonrtric} nonrtric-recipe --from-file=recipe=$OVERRIDEYAML
echo "install-ranpm.sh completed"
fi
-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"
+helm install -f $OVERRIDEYAML -n "${NONRTRIC_NAMESPACE:-nonrtric}" ${HELM_NAME_OPT} "${RELEASE_PREFIX}" "$ROOT_DIR/../nonrtric/helm/nonrtric"