nexus+mariadb upgrade to latest patch versions
[oom.git] / kubernetes / appc / resources / config / appc / opt / onap / appc / bin / 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 ENABLE_ODL_CLUSTER=${ENABLE_ODL_CLUSTER:-false}
27 APPC_FEATURE_DIR=${APPC_FEATURE_DIR:-${APPC_HOME}/features}
28
29 function featureInstall {
30 COUNT=0
31 while [ $COUNT -lt 10 ]; do
32   ${ODL_HOME}/bin/client feature:install $1 2> /tmp/installErr
33   cat /tmp/installErr
34   if grep -q 'Failed to get the session' /tmp/installErr; then
35     sleep 10
36   else
37     let COUNT=10
38   fi
39   let COUNT=COUNT+1
40 done
41 }
42
43  APPC_FEATURES=" \
44  appc-metric \
45  appc-dmaap-adapter \
46  appc-chef-adapter \
47  appc-netconf-adapter \
48  appc-rest-adapter \
49  appc-lifecycle-management \
50  appc-dispatcher \
51  appc-provider \
52  appc-dg-util \
53  appc-dg-shared \
54  appc-sdc-listener \
55  appc-oam \
56  appc-iaas-adapter \
57  appc-ansible-adapter \
58  appc-sequence-generator \
59  appc-artifact-handler \
60  appc-aai-client"
61
62 APPC_FEATURES_1=" \
63  onap-appc-core \
64  onap-appc-metric \
65  onap-appc-dmaap-adapter \
66  onap-appc-chef-adapter \
67  onap-appc-netconf-adapter \
68  onap-appc-rest-adapter \
69  onap-appc-lifecycle-management \
70  onap-appc-license-manager"
71
72  APPC_FEATURES_2=" \
73  onap-appc-dg-util \
74  onap-appc-dg-shared \
75  onap-appc-sdc-listener \
76  onap-appc-oam \
77  onap-appc-iaas-adapter \
78  onap-appc-ansible-adapter \
79  onap-appc-sequence-generator \
80  onap-appc-config-generator \
81  onap-appc-config-data-services \
82  onap-appc-config-adaptor \
83  onap-appc-config-audit \
84  onap-appc-config-encryption-tool \
85  onap-appc-config-flow-controller \
86  onap-appc-config-params \
87  onap-appc-artifact-handler
88  onap-appc-aai-client \
89  onap-appc-event-listener \
90  onap-appc-network-inventory-client \
91  onap-appc-design-services \
92  onap-appc-interfaces-service"
93
94  APPC_FEATURES_UNZIP=" \
95  appc-core \
96  appc-metric \
97  appc-dmaap-adapter \
98  appc-event-listener \
99  appc-chef-adapter \
100  appc-netconf-adapter \
101  appc-rest-adapter \
102  appc-lifecycle-management \
103  appc-dispatcher \
104  appc-provider \
105  appc-dg-util \
106  appc-dg-shared \
107  appc-sdc-listener \
108  appc-oam \
109  appc-iaas-adapter \
110  appc-ansible-adapter \
111  appc-sequence-generator \
112  appc-config-generator \
113  appc-config-data-services \
114  appc-config-adaptor \
115  appc-config-audit \
116  appc-config-encryption-tool \
117  appc-config-flow-controller \
118  appc-config-params \
119  appc-artifact-handler \
120  appc-aai-client \
121  appc-network-inventory-client \
122  appc-design-services \
123  appc-interfaces-service"
124
125
126 if $ENABLE_ODL_CLUSTER
127   then
128     echo "Enabling core APP-C features with clustering enabled"
129     featureInstall odl-netconf-connector-all
130     featureInstall odl-restconf-noauth
131     featureInstall odl-netconf-clustered-topology
132   else
133     echo "Enabling core APP-C features with clustering disabled"
134     featureInstall odl-netconf-connector-all
135     featureInstall odl-restconf-noauth
136     featureInstall odl-netconf-topology
137 fi
138
139 sleep 7s
140 echo "Installing APP-C Features"
141 echo ""
142
143 for feature in ${APPC_FEATURES_UNZIP}
144 do
145   if [ -f ${APPC_FEATURE_DIR}/${feature}/install-feature.sh ]
146   then
147     ${APPC_FEATURE_DIR}/${feature}/install-feature.sh
148   else
149     echo "No installer found for feature ${feature}"
150   fi
151 done
152
153 #${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
154
155 for feature in ${APPC_FEATURES_1}
156 do
157   echo "Installing ${feature}"
158   start=$(date +%s)
159   ${ODL_HOME}/bin/client "feature:install -r ${feature}"
160   end=$(date +%s)
161   echo "Install of ${feature} took $(expr $end - $start) seconds"
162   sleep 7s
163   echo "Sleep Finished"
164 done
165
166   echo "Installing dispatcher features"
167   start=$(date +%s)
168   ${ODL_HOME}/bin/client "feature:install -r onap-appc-request-handler onap-appc-command-executor onap-appc-lifecycle-management onap-appc-workflow-management lock-manager onap-appc-provider"
169   end=$(date +%s)
170   echo "Install of dispatcher features took $(expr $end - $start) seconds"
171   sleep 7s
172   echo "Sleep Finished"
173
174 for feature in ${APPC_FEATURES_2}
175 do
176   echo "Installing ${feature}"
177   start=$(date +%s)
178   ${ODL_HOME}/bin/client "feature:install -r ${feature}"
179   end=$(date +%s)
180   echo "Install of ${feature} took $(expr $end - $start) seconds"
181   sleep 7s
182   echo "Sleep Finished"
183 done
184