From: Zhe Huang Date: Fri, 24 May 2019 16:16:48 +0000 (-0400) Subject: Fix the wrong path in the install scripts X-Git-Tag: 0.0.2~102 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=fc4f466d6a05466097cdcfff1990e732c3b288b0;p=it%2Fdep.git Fix the wrong path in the install scripts Signed-off-by: Zhe Huang Change-Id: I26746508007ff8d4b2aed87a90c6b95628ab4990 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..ec0ccdeb --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# ignore all logs +*.log +*.tar +*.tgz diff --git a/aux/80-Auxiliary-Functions/bin/install b/aux/80-Auxiliary-Functions/bin/install index 8e8170d7..de7c09b4 100755 --- a/aux/80-Auxiliary-Functions/bin/install +++ b/aux/80-Auxiliary-Functions/bin/install @@ -43,17 +43,18 @@ echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" -COMMON_CHART_VERSION=$(cat $DIR/../../50-RIC-Platform/charts/common/Chart.yaml | grep version | awk '{print $2}') +COMMON_CHART_VERSION=$(cat $DIR/../../../ric-platform/50-RIC-Platform/helm/common/Chart.yaml | grep version | awk '{print $2}') -helm package -d /tmp $DIR/../../50-RIC-Platform/charts/common +helm package -d /tmp $DIR/../../../ric-platform/50-RIC-Platform/helm/common for component in $RICAUX_COMPONENTS; do echo "Preparing chart for comonent $component" - cp /tmp/common-$COMMON_CHART_VERSION.tgz $DIR/../charts/$component/charts/ + mkdir -p $DIR/../helm/$component/charts/ + cp /tmp/common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/ if [ -z $OVERRIDEYAML ]; then - helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../charts/$component + helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../helm/$component else - helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../charts/$component + helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../helm/$component fi done diff --git a/infra/10-Nexus/bin/install b/infra/10-Nexus/bin/install index 18102f80..c0c5ed04 100755 --- a/infra/10-Nexus/bin/install +++ b/infra/10-Nexus/bin/install @@ -44,7 +44,7 @@ echo "Deploying nexus repo managers for local docker registry and helm repo." echo "Name Space: $NAMESPACE" echo "Helm Release: $RELEASE_NAME" -HOSTPOSTFIX=$(cat $DIR/../charts/values.yaml | grep hostpostfix | awk '{print $2}') +HOSTPOSTFIX=$(cat $DIR/../helm/values.yaml | grep hostpostfix | awk '{print $2}') echo "****************************************************************************************************************" @@ -57,15 +57,17 @@ echo "You can access this nexus here: http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NE echo "If nexus.$HOSTPOSTFIX is not resolved by your DNS server, please add an entry in your /etc/hosts file." echo "****************************************************************************************************************" -COMMON_CHART_VERSION=$(cat $DIR/../../50-RIC-Platform/charts/common/Chart.yaml | grep version | awk '{print $2}') -helm package -d /tmp $DIR/../../50-RIC-Platform/charts/common +COMMON_CHART_VERSION=$(cat $DIR/../../../ric-platform/50-RIC-Platform/helm/common/Chart.yaml | grep version | awk '{print $2}') +helm package -d /tmp $DIR/../../../ric-platform/50-RIC-Platform/helm/common -cp /tmp/common-$COMMON_CHART_VERSION.tgz $DIR/../charts/charts/ + +mkdir -p $DIR/../helm/charts/ +cp /tmp/common-$COMMON_CHART_VERSION.tgz $DIR/../helm/charts/ if [ -z $OVERRIDEYAML ]; then -helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-nexus" $DIR/../charts +helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-nexus" $DIR/../helm else -helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-nexus" $DIR/../charts +helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-nexus" $DIR/../helm fi NEXUS_POD_NAME=$(kubectl get pod -n $NAMESPACE | grep nexus | grep ContainerCreating | awk '{print $1}') @@ -100,7 +102,7 @@ done echo $IS_NEXUS_READY -DOCKERPORT=$(cat $DIR/../charts/templates/deployment.yaml | awk '/.*- name: docker.*/{getline; print $2}') +DOCKERPORT=$(cat $DIR/../helm/templates/deployment.yaml | awk '/.*- name: docker.*/{getline; print $2}') DOCKERREPOSCRIPT="{\"name\":\"create_docker_repo\",\ diff --git a/infra/10-Nexus/bin/uninstall b/infra/10-Nexus/bin/uninstall new file mode 100755 index 00000000..d185b61a --- /dev/null +++ b/infra/10-Nexus/bin/uninstall @@ -0,0 +1,46 @@ +#!/bin/bash +################################################################################ +# Copyright (c) 2019 AT&T Intellectual Property. # +# Copyright (c) 2019 Nokia. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ + +OVERRIDEYAML=$1 + + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +source $DIR/../etc/nexus.conf + +if [ -z "$RICINFRA_RELEASE_NAME" ];then + RELEASE_NAME=$helm_release_name +else + RELEASE_NAME=$RICINFRA_RELEASE_NAME +fi +if [ -z "$RICINFRA_NAMESPACE" ];then + NAMESPACE=$namespace +else + NAMESPACE=$RICINFRA_NAMESPACE +fi +if [ -z "$INGRESS_PORT" ];then + INGRESS_PORT_NEXUS=$ingress_port +else + INGRESS_PORT_NEXUS=$INGRESS_PORT +fi + + + +echo "Undeploying nexus repo managers for local docker registry and helm repo." +echo "Name Space: $NAMESPACE" +echo "Helm Release: $RELEASE_NAME" +helm delete --purge "${RELEASE_NAME}-nexus" diff --git a/infra/10-Nexus/helm/templates/ingress.yaml b/infra/10-Nexus/helm/templates/ingress.yaml index 078f1af1..36090229 100644 --- a/infra/10-Nexus/helm/templates/ingress.yaml +++ b/infra/10-Nexus/helm/templates/ingress.yaml @@ -14,12 +14,10 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ - -{{- $fullName := include "nexus.fullname" . -}} apiVersion: extensions/v1beta1 kind: Ingress metadata: - name: {{ $fullName }} + name: {{ include "nexus.fullname" . }} labels: app: {{ template "nexus.name" . }} chart: {{ template "nexus.chart" . }} @@ -35,11 +33,11 @@ spec: http: paths: - backend: - serviceName: {{ $fullName }} + serviceName: {{ include "nexus.fullname" . }} servicePort: nexus - host: docker.{{ .Values.ingress.hostpostfix }} http: paths: - backend: - serviceName: {{ $fullName }} + serviceName: {{ include "nexus.fullname" . }} servicePort: docker diff --git a/ric-platform/20-Credential/bin/install b/ric-platform/20-Credential/bin/install index c3f75065..c2c86e45 100755 --- a/ric-platform/20-Credential/bin/install +++ b/ric-platform/20-Credential/bin/install @@ -37,8 +37,8 @@ else fi if [ -z $OVERRIDEYAML ]; then - helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-credential" $DIR/../charts + helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-credential" $DIR/../helm else - helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-credential" $DIR/../charts + helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-credential" $DIR/../helm fi diff --git a/ric-platform/20-Credential/bin/uninstall b/ric-platform/20-Credential/bin/uninstall new file mode 100755 index 00000000..f93004a6 --- /dev/null +++ b/ric-platform/20-Credential/bin/uninstall @@ -0,0 +1,40 @@ +#!/bin/bash +################################################################################ +# Copyright (c) 2019 AT&T Intellectual Property. # +# Copyright (c) 2019 Nokia. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ + + +OVERRIDEYAML=$1 + + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + + +source $DIR/../etc/credential.conf + +if [ -z "$RICPLT_RELEASE_NAME" ];then + RELEASE_NAME=$helm_release_name +else + RELEASE_NAME=$RICPLT_RELEASE_NAME +fi +if [ -z "$RICPLT_NAMESPACE" ];then + NAMESPACE=$namespace +else + NAMESPACE=$RICPLT_NAMESPACE +fi + + helm delete --purge "${RELEASE_NAME}-credential" + diff --git a/ric-platform/50-RIC-Platform/bin/install b/ric-platform/50-RIC-Platform/bin/install index 87040d79..53023f3c 100755 --- a/ric-platform/50-RIC-Platform/bin/install +++ b/ric-platform/50-RIC-Platform/bin/install @@ -44,17 +44,18 @@ echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" -COMMON_CHART_VERSION=$(cat $DIR/../charts/common/Chart.yaml | grep version | awk '{print $2}') +COMMON_CHART_VERSION=$(cat $DIR/../helm/common/Chart.yaml | grep version | awk '{print $2}') -helm package -d /tmp $DIR/../charts/common +helm package -d /tmp $DIR/../helm/common for component in $RICPLT_COMPONENTS; do echo "Preparing chart for comonent $component" - cp /tmp/common-$COMMON_CHART_VERSION.tgz $DIR/../charts/$component/charts/ + mkdir -p $DIR/../helm/$component/charts/ + cp /tmp/common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/ if [ -z $OVERRIDEYAML ]; then - helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../charts/$component + helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../helm/$component else - helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../charts/$component + helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../helm/$component fi done