Deployment onap rename
[appc/deployment.git] / installation / appc / src / main / scripts / installFeatures.sh
1 #!/bin/bash
2
3 ###
4 # ============LICENSE_START=======================================================
5 # APPC
6 # ================================================================================
7 # Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
8 # ================================================================================
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
12
13 #      http://www.apache.org/licenses/LICENSE-2.0
14
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
20 # ============LICENSE_END=========================================================
21 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 ###
23
24 ODL_HOME=${ODL_HOME:-/opt/opendaylight/current}
25 APPC_HOME=${APPC_HOME:-/opt/onap/appc}
26 APPC_FEATURE_DIR=${APPC_FEATURE_DIR:-${APPC_HOME}/features}
27
28 function featureInstall {
29 COUNT=0
30 while [ $COUNT -lt 10 ]; do
31   ${ODL_HOME}/bin/client -u karaf feature:install $1 2> /tmp/installErr
32   cat /tmp/installErr
33   if grep -q 'Failed to get the session' /tmp/installErr; then
34     sleep 10
35   else
36     let COUNT=10
37   fi
38   let COUNT=COUNT+1
39 done
40 }
41
42 APPC_FEATURES=" \
43  appc-metric \
44  appc-command-executor \
45  appc-dmaap-adapter \
46  appc-event-listener \
47  appc-chef-adapter \
48  appc-netconf-adapter \
49  appc-rest-adapter \
50  appc-lifecycle-management \
51  appc-dispatcher \
52  appc-provider \
53  appc-dg-util \
54  appc-dg-shared \
55  appc-sdc-listener \
56  appc-oam \
57  appc-iaas-adapter \
58  appc-ansible-adapter \
59  appc-sequence-generator \
60  appc-config-generator \
61  appc-config-data-services \
62  appc-artifact-handler \
63  appc-config-adaptor \
64  appc-config-audit \
65  appc-config-encryption-tool \
66  appc-config-flow-controller \
67  appc-config-params \
68  appc-aai-client"
69
70 # Temp fix to fix bouncycastle issue that is preventing netconf to work correctly
71 apt-get -y install wget
72 wget -P /opt/opendaylight/current/deploy https://www.bouncycastle.org/download/bcprov-jdk15on-158.jar
73 wget -P /opt/opendaylight/current/deploy https://www.bouncycastle.org/download/bcprov-ext-jdk15on-158.jar
74
75 echo "Enabling core APP-C features"
76 featureInstall odl-netconf-connector-all
77 featureInstall odl-restconf-noauth
78 featureInstall odl-netconf-topology
79
80 echo "Installing APP-C Features"
81 echo ""
82
83 for feature in ${APPC_FEATURES}
84 do
85   if [ -f ${APPC_FEATURE_DIR}/${feature}/install-feature.sh ]
86   then
87     ${APPC_FEATURE_DIR}/${feature}/install-feature.sh
88   else
89     echo "No installer found for feature ${feature}"
90   fi
91 done