Fix the wrong path in the install scripts 95/195/1
authorZhe Huang <zhehuang@research.att.com>
Fri, 24 May 2019 16:16:48 +0000 (12:16 -0400)
committerZhe Huang <zhehuang@research.att.com>
Fri, 24 May 2019 16:16:48 +0000 (12:16 -0400)
Signed-off-by: Zhe Huang <zhehuang@research.att.com>
Change-Id: I26746508007ff8d4b2aed87a90c6b95628ab4990

.gitignore [new file with mode: 0644]
aux/80-Auxiliary-Functions/bin/install
infra/10-Nexus/bin/install
infra/10-Nexus/bin/uninstall [new file with mode: 0755]
infra/10-Nexus/helm/templates/ingress.yaml
ric-platform/20-Credential/bin/install
ric-platform/20-Credential/bin/uninstall [new file with mode: 0755]
ric-platform/50-RIC-Platform/bin/install

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..ec0ccde
--- /dev/null
@@ -0,0 +1,4 @@
+# ignore all logs
+*.log
+*.tar
+*.tgz
index 8e8170d..de7c09b 100755 (executable)
@@ -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
index 18102f8..c0c5ed0 100755 (executable)
@@ -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 (executable)
index 0000000..d185b61
--- /dev/null
@@ -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" 
index 078f1af..3609022 100644 (file)
 #   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
index c3f7506..c2c86e4 100755 (executable)
@@ -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 (executable)
index 0000000..f93004a
--- /dev/null
@@ -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"
+
index 87040d7..53023f3 100755 (executable)
@@ -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