Set appc-interfaces-service to 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  appc-event-listener \
89  appc-network-inventory-client \
90  appc-design-services \
91  appc-interfaces-service"
92  
93  APPC_FEATURES_UNZIP=" \
94  appc-metric \
95  appc-dmaap-adapter \
96  appc-event-listener \
97  appc-chef-adapter \
98  appc-netconf-adapter \
99  appc-rest-adapter \
100  appc-lifecycle-management \
101  appc-dispatcher \
102  appc-provider \
103  appc-dg-util \
104  appc-dg-shared \
105  appc-sdc-listener \
106  appc-oam \
107  appc-iaas-adapter \
108  appc-ansible-adapter \
109  appc-sequence-generator \
110  appc-config-generator \
111  appc-config-data-services \
112  appc-config-adaptor \
113  appc-config-audit \
114  appc-config-encryption-tool \
115  appc-config-flow-controller \
116  appc-config-params \
117  appc-artifact-handler \
118  appc-aai-client \
119  appc-network-inventory-client \
120  appc-design-services \
121  appc-interfaces-service"
122  
123
124  
125
126
127 echo "Enabling core APP-C features"
128 featureInstall odl-netconf-connector-all
129 featureInstall odl-restconf-noauth
130 featureInstall odl-netconf-topology
131
132 sleep 7s
133 echo "Installing APP-C Features"
134 echo ""
135
136 for feature in ${APPC_FEATURES_UNZIP}
137 do
138   if [ -f ${APPC_FEATURE_DIR}/${feature}/install-feature.sh ]
139   then
140     ${APPC_FEATURE_DIR}/${feature}/install-feature.sh
141   else
142     echo "No installer found for feature ${feature}"
143   fi
144 done
145
146 #${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
147
148 for feature in ${APPC_FEATURES_1}
149 do
150   echo "Installing ${feature}"
151   start=$(date +%s)
152   ${ODL_HOME}/bin/client "feature:install -r ${feature}"
153   end=$(date +%s)
154   echo "Install of ${feature} took $(expr $end - $start) seconds"
155   sleep 7s
156   echo "Sleep Finished"
157 done
158
159   echo "Installing dispatcher features"
160   start=$(date +%s)
161   ${ODL_HOME}/bin/client "feature:install -r appc-request-handler appc-command-executor appc-lifecycle-management appc-workflow-management lock-manager"
162   end=$(date +%s)
163   echo "Install of dispatcher features took $(expr $end - $start) seconds"
164   sleep 7s
165   echo "Sleep Finished"
166
167 for feature in ${APPC_FEATURES_2}
168 do
169   echo "Installing ${feature}"
170   start=$(date +%s)
171   ${ODL_HOME}/bin/client "feature:install -r ${feature}"
172   end=$(date +%s)
173   echo "Install of ${feature} took $(expr $end - $start) seconds"
174   sleep 7s
175   echo "Sleep Finished"
176 done