Merge "DG changes for the closed loop and async support in MDONS"
[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/onap/sdnc}
32
33 targetDir=${1:-${SDNC_HOME}}
34 featureDir=${targetDir}/features
35
36
37 SDNC_NORTHBOUND_FEATURES=" \
38   generic-resource-api \
39   vnfapi \
40   vnftools"
41
42
43
44 SDNC_NORTHBOUND_VERSION=${SDNC_NORTHBOUND_VERSION:-1.2.0}
45 SDNC_OAM_VERSION=${SDNC_OAM_VERSION:-1.2.0}
46
47 if [ ! -d ${targetDir} ]
48 then
49   mkdir -p ${targetDir}
50 fi
51
52 if [ ! -d ${featureDir} ]
53 then
54   mkdir -p ${featureDir}
55 fi
56
57 cwd=$(pwd)
58
59 mavenOpts=${2:-"-s ${SETTINGS_FILE} -gs ${GLOBAL_SETTINGS_FILE}"}
60 cd /tmp
61
62 echo "Installing SDN-C core version ${SDNC_CORE_VERSION}"
63 for feature in ${SDNC_CORE_FEATURES}
64 do
65  rm -f /tmp/${feature}-installer*.zip
66 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.core:${feature}-installer:${SDNC_CORE_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
67  unzip -d ${featureDir} /tmp/${feature}-installer*zip
68 done
69
70 echo "Installing SDN-C adaptors version ${SDNC_ADAPTORS_VERSION}"
71 for feature in ${SDNC_ADAPTORS_FEATURES}
72 do
73  rm -f /tmp/${feature}-installer*.zip
74 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.adaptors:${feature}-installer:${SDNC_ADAPTORS_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
75  unzip -d ${featureDir} /tmp/${feature}-installer*zip
76 done
77
78 echo "Installing SDN-C northbound version ${SDNC_NORTHBOUND_VERSION}"
79 for feature in ${SDNC_NORTHBOUND_FEATURES}
80 do
81  rm -f /tmp/${feature}-installer*.zip
82 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.northbound:${feature}-installer:${SDNC_NORTHBOUND_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
83  unzip -d ${featureDir} /tmp/${feature}-installer*zip
84 done
85
86 echo "Installing SDN-C plugins version ${SDNC_PLUGINS_VERSION}"
87 for feature in ${SDNC_PLUGINS_FEATURES}
88 do
89  rm -f /tmp/${feature}-installer*.zip
90 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.plugins:${feature}-installer:${SDNC_PLUGINS_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
91  unzip -d ${featureDir} /tmp/${feature}-installer*zip
92 done
93
94
95
96 echo "Installing platform-logic"
97 rm -f /tmp/platform-logic-installer*.zip
98 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.oam:platform-logic-installer:${SDNC_OAM_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
99 unzip -d ${targetDir} /tmp/platform-logic-installer*.zip
100
101 find ${targetDir} -name '*.sh' -exec chmod +x '{}' \;
102
103 cd $cwd
104