Remove event-listener auto install
[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 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-dmaap-adapter \
45  appc-chef-adapter \
46  appc-netconf-adapter \
47  appc-rest-adapter \
48  appc-lifecycle-management \
49  appc-dispatcher \
50  appc-provider \
51  appc-dg-util \
52  appc-dg-shared \
53  appc-sdc-listener \
54  appc-oam \
55  appc-iaas-adapter \
56  appc-ansible-adapter \
57  appc-sequence-generator \
58  appc-artifact-handler \
59  appc-aai-client"
60
61 APPC_FEATURES_1=" \
62  appc-metric \
63  appc-dmaap-adapter \
64  appc-chef-adapter \
65  appc-netconf-adapter \
66  appc-rest-adapter \
67  appc-lifecycle-management \
68  appc-license-manager"
69  
70  APPC_FEATURES_2=" \
71  appc-provider \
72  appc-dg-util \
73  appc-dg-shared \
74  appc-sdc-listener \
75  appc-oam \
76  appc-iaas-adapter \
77  appc-ansible-adapter \
78  appc-sequence-generator \
79  appc-config-generator \
80  appc-config-data-services \
81  appc-config-adaptor \
82  appc-config-audit \
83  appc-config-encryption-tool \
84  appc-config-flow-controller \
85  appc-config-params \
86  appc-artifact-handler \
87  appc-aai-client"
88  
89  APPC_FEATURES_UNZIP=" \
90  appc-metric \
91  appc-dmaap-adapter \
92  appc-event-listener \
93  appc-chef-adapter \
94  appc-netconf-adapter \
95  appc-rest-adapter \
96  appc-lifecycle-management \
97  appc-dispatcher \
98  appc-provider \
99  appc-dg-util \
100  appc-dg-shared \
101  appc-sdc-listener \
102  appc-oam \
103  appc-iaas-adapter \
104  appc-ansible-adapter \
105  appc-sequence-generator \
106  appc-config-generator \
107  appc-config-data-services \
108  appc-config-adaptor \
109  appc-config-audit \
110  appc-config-encryption-tool \
111  appc-config-flow-controller \
112  appc-config-params \
113  appc-artifact-handler \
114  appc-aai-client"
115  
116
117  
118
119
120 echo "Enabling core APP-C features"
121 featureInstall odl-netconf-connector-all
122 featureInstall odl-restconf-noauth
123 featureInstall odl-netconf-topology
124
125 sleep 7s
126 echo "Installing APP-C Features"
127 echo ""
128
129 for feature in ${APPC_FEATURES_UNZIP}
130 do
131   if [ -f ${APPC_FEATURE_DIR}/${feature}/install-feature.sh ]
132   then
133     ${APPC_FEATURE_DIR}/${feature}/install-feature.sh
134   else
135     echo "No installer found for feature ${feature}"
136   fi
137 done
138
139 #${ODL_HOME}/bin/client feature:install appc-metric appc-dmaap-adapter appc-event-listener appc-chef-adapter appc-netconf-adapter appc-rest-adapter appc-lifecycle-management appc-dispatcher appc-provider appc-dg-util appc-dg-shared appc-sdc-listener appc-oam appc-iaas-adapter appc-ansible-adapter appc-sequence-generator appc-config-generator appc-config-data-services appc-config-adaptor appc-config-audit appc-config-encryption-tool appc-config-flow-controller appc-config-params appc-artifact-handler appc-aai-client
140
141 for feature in ${APPC_FEATURES_1}
142 do
143   echo "Installing ${feature}"
144   start=$(date +%s)
145   ${ODL_HOME}/bin/client "feature:install -r ${feature}"
146   end=$(date +%s)
147   echo "Install of ${feature} took $(expr $end - $start) seconds"
148   sleep 7s
149   echo "Sleep Finished"
150 done
151
152   echo "Installing dispatcher features"
153   start=$(date +%s)
154   ${ODL_HOME}/bin/client "feature:install -r appc-request-handler appc-command-executor appc-lifecycle-management appc-workflow-management lock-manager"
155   end=$(date +%s)
156   echo "Install of dispatcher features took $(expr $end - $start) seconds"
157   sleep 7s
158   echo "Sleep Finished"
159
160 for feature in ${APPC_FEATURES_2}
161 do
162   echo "Installing ${feature}"
163   start=$(date +%s)
164   ${ODL_HOME}/bin/client "feature:install -r ${feature}"
165   end=$(date +%s)
166   echo "Install of ${feature} took $(expr $end - $start) seconds"
167   sleep 7s
168   echo "Sleep Finished"
169 done