[SDNC-7] Remove ODL tarball
[sdnc/oam.git] / installation / sdnc / src / main / scripts / installZips.sh
1 #!/bin/bash
2
3 ###
4 # ============LICENSE_START=======================================================
5 # openECOMP : SDN-C
6 # ================================================================================
7 # Copyright (C) 2017 AT&T Intellectual Property. All rights
8 #                                                       reserved.
9 # ================================================================================
10 # Licensed under the Apache License, Version 2.0 (the "License");
11 # you may not use this file except in compliance with the License.
12 # You may obtain a copy of the License at
13
14 #      http://www.apache.org/licenses/LICENSE-2.0
15
16 # Unless required by applicable law or agreed to in writing, software
17 # distributed under the License is distributed on an "AS IS" BASIS,
18 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # See the License for the specific language governing permissions and
20 # limitations under the License.
21 # ============LICENSE_END=========================================================
22 ###
23
24 if [ -z "$SETTINGS_FILE" -a -z "$GLOBAL_SETTINGS_FILE" -a -s "$HOME"/.m2/settings.xml ]
25 then
26   DEFAULT_MAVEN_SETTINGS=${HOME}/.m2/settings.xml
27   SETTINGS_FILE=${SETTINGS_FILE:-${DEFAULT_MAVEN_SETTINGS}}
28   GLOBAL_SETTINGS_FILE=${GLOBAL_SETTINGS_FILE:-${DEFAULT_MAVEN_SETTINGS}}
29 fi
30
31 SDNC_HOME=${SDNC_HOME:-/opt/openecomp/sdnc}
32
33 targetDir=${1:-${SDNC_HOME}}
34 featureDir=${targetDir}/features
35
36 SDNC_CORE_FEATURES=" \
37  dblib \
38  filters \
39  sli \
40  sliPluginUtils \
41  sliapi"
42
43 SDNC_ADAPTORS_FEATURES=" \
44   aai-service \
45   mdsal-resource \
46   resource-assignment \
47   sql-resource"
48
49 SDNC_NORTHBOUND_FEATURES=" \
50   asdcApi \
51   dataChange \
52   vnfapi \
53   vnftools"
54
55 SDNC_PLUGINS_FEATURES=" \
56   properties-node \
57   restapi-call-node"
58
59
60 SDNC_CORE_VERSION=${SDNC_CORE_VERSION:-0.1.1}
61 SDNC_ADAPTORS_VERSION=${SDNC_ADAPTORS_VERSION:-0.1.1}
62 SDNC_NORTHBOUND_VERSION=${SDNC_NORTHBOUND_VERSION:-0.1.1}
63 SDNC_PLUGINS_VERSION=${SDNC_PLUGINS_VERSION:-0.1.1}
64 SDNC_OAM_VERSION=${SDNC_OAM_VERSION:-0.1.1}
65
66 if [ ! -d ${targetDir} ]
67 then
68   mkdir -p ${targetDir}
69 fi
70
71 if [ ! -d ${featureDir} ]
72 then
73   mkdir -p ${featureDir}
74 fi
75
76 cwd=$(pwd)
77
78 mavenOpts=${2:-"-s ${SETTINGS_FILE} -gs ${GLOBAL_SETTINGS_FILE}"}
79 cd /tmp
80
81 echo "Installing SDN-C core version ${SDNC_CORE_VERSION}"
82 for feature in ${SDNC_CORE_FEATURES}
83 do
84  rm -f /tmp/${feature}-installer*.zip
85 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.openecomp.sdnc.core:${feature}-installer:${SDNC_CORE_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
86  unzip -d ${featureDir} /tmp/${feature}-installer*zip
87 done
88
89 echo "Installing SDN-C adaptors version ${SDNC_ADAPTORS_VERSION}"
90 for feature in ${SDNC_ADAPTORS_FEATURES}
91 do
92  rm -f /tmp/${feature}-installer*.zip
93 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.openecomp.sdnc.adaptors:${feature}-installer:${SDNC_ADAPTORS_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
94  unzip -d ${featureDir} /tmp/${feature}-installer*zip
95 done
96
97 echo "Installing SDN-C northbound version ${SDNC_NORTHBOUND_VERSION}"
98 for feature in ${SDNC_NORTHBOUND_FEATURES}
99 do
100  rm -f /tmp/${feature}-installer*.zip
101 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.openecomp.sdnc.northbound:${feature}-installer:${SDNC_NORTHBOUND_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
102  unzip -d ${featureDir} /tmp/${feature}-installer*zip
103 done
104
105 echo "Installing SDN-C plugins version ${SDNC_PLUGINS_VERSION}"
106 for feature in ${SDNC_PLUGINS_FEATURES}
107 do
108  rm -f /tmp/${feature}-installer*.zip
109 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.openecomp.sdnc.plugins:${feature}-installer:${SDNC_PLUGINS_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
110  unzip -d ${featureDir} /tmp/${feature}-installer*zip
111 done
112
113
114
115 echo "Installing platform-logic"
116 rm -f /tmp/platform-logic-installer*.zip
117 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.openecomp.sdnc.oam:platform-logic-installer:${SDNC_OAM_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
118 unzip -d ${targetDir} /tmp/platform-logic-installer*.zip
119
120 find ${targetDir} -name '*.sh' -exec chmod +x '{}' \;
121
122 cd $cwd
123