Modify installFeatures.sh script
[appc/deployment.git] / installation / appc / src / main / scripts / installFeatures.sh
1 #!/bin/bash
2
3 ODL_HOME=${ODL_HOME:-/opt/opendaylight/current}
4 APPC_HOME=${APPC_HOME:-/opt/openecomp/appc}
5 APPC_FEATURE_DIR=${APPC_FEATURE_DIR:-${APPC_HOME}/features}
6
7 function featureInstall {
8 COUNT=0
9 while [ $COUNT -lt 10 ]; do
10   ${ODL_HOME}/bin/client -u karaf feature:install $1 2> /tmp/installErr
11   cat /tmp/installErr
12   if grep -q 'Failed to get the session' /tmp/installErr; then
13     sleep 10
14   else
15     let COUNT=10
16   fi
17   let COUNT=COUNT+1
18 done
19 }
20
21 APPC_FEATURES=" \
22  appc-provider \
23  appc-event-listener \
24  appc-dispatcher \
25  appc-chef-adapter \
26  appc-netconf-adapter \
27  appc-rest-adapter \
28  appc-dmaap-adapter \
29  appc-dg-util \
30  appc-metric \
31  appc-dg-shared \
32  appc-asdc-listener"
33  
34 echo "Enabling core APP-C features"
35 featureInstall odl-netconf-connector-all
36 featureInstall odl-restconf-noauth
37 featureInstall odl-netconf-topology
38
39 # When the karaf netconf feature gets installed, need to replace default password with OpenECOMP APP-C ODL Password
40 sed -i 's/admin<\/password>/Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U<\/password>/' ${ODL_HOME}/etc/opendaylight/karaf/99-netconf-connector.xml
41
42 echo "Installing APP-C Features"
43 echo ""
44
45 for feature in ${APPC_FEATURES}
46 do
47   if [ -f ${APPC_FEATURE_DIR}/${feature}/install-feature.sh ]
48   then
49     ${APPC_FEATURE_DIR}/${feature}/install-feature.sh
50   else
51     echo "No installer found for feature ${feature}"
52   fi
53 done