Update repo URL domain name
[it/dep.git] / ricplt / ric_install.sh
1 #!/bin/bash
2 ################################################################################
3 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
4 #   Copyright (c) 2019 Nokia.                                                  #
5 #                                                                              #
6 #   Licensed under the Apache License, Version 2.0 (the "License");            #
7 #   you may not use this file except in compliance with the License.           #
8 #   You may obtain a copy of the License at                                    #
9 #                                                                              #
10 #       http://www.apache.org/licenses/LICENSE-2.0                             #
11 #                                                                              #
12 #   Unless required by applicable law or agreed to in writing, software        #
13 #   distributed under the License is distributed on an "AS IS" BASIS,          #
14 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
15 #   See the License for the specific language governing permissions and        #
16 #   limitations under the License.                                             #
17 ################################################################################
18
19
20 if [ -z "$RICPLT_RELEASE_NAME" ] || \
21    [ -z "$RICPLT_COMPONENTS" ] || \
22    [ -z "$RICPLT_NAMESPACE" ] || \
23    [ -z "$RICPLT_APPMGR_EXT_PORT" ] || \
24    [ -z "$RICPLT_E2MGR_EXT_PORT" ]; then
25   echo "RICPLT_RELEASE_NAME or RICPLT_COMPONENTS or RICPLT_NAMESPACE or "
26   echo "RICPLT_APPMGR_EXT_PORT or RICPLT_E2MGR_EXT_PORT unset, loading "
27   echo "values from ric_env.sh"
28   . ./ric_env.sh
29 fi
30
31
32 RICPLT_DEPLOYMENT="$RICPLT_RELEASE_NAME"
33 echo "Deplot RIC Platform components [$RICPLT_COMPONENTS] to"
34 echo "name space: $RICPLT_NAMESPACE, Helm release: $RICPLT_DEPLOYMENT"
35
36
37 rm -rf dist
38 mkdir -p dist/packages
39
40 helm serve --repo-path dist/packages &
41
42 sleep 1
43
44 helm repo add local http://127.0.0.1:8879
45
46 helm repo update
47 helm package -d dist/packages common
48 helm repo index dist/packages
49
50
51 for c in common preric $RICPLT_COMPONENTS  ric; do
52   echo "Preparing chart for comonent $c"
53   helm repo update
54   if [ -e "$c/requirements.yaml" ]; then
55     helm dep up "$c"
56   fi
57   helm package -d dist/packages "$c"
58   helm repo index dist/packages
59   echo
60 done
61
62 helm repo update
63 helm install local/preric --namespace "${RICPLT_NAMESPACE}" --name pre-"${RICPLT_RELEASE_NAME}"
64
65 helm repo update
66 helm install local/ric --namespace "${RICPLT_NAMESPACE}" --name "${RICPLT_RELEASE_NAME}" --set appmgr.appmgr.service.appmgr.extport="${RICPLT_APPMGR_EXT_PORT}" --set e2mgr.e2mgr.service.http.extport="${RICPLT_E2MGR_EXT_PORT}"
67
68