Chore: Add gerrit maven verify GHA workflow
[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 if [ ! -d ${targetDir} ]
45 then
46   mkdir -p ${targetDir}
47 fi
48
49 if [ ! -d ${featureDir} ]
50 then
51   mkdir -p ${featureDir}
52 fi
53
54 cwd=$(pwd)
55
56 mavenOpts=${2:-"-s ${SETTINGS_FILE} -gs ${GLOBAL_SETTINGS_FILE}"}
57 cd /tmp
58
59 echo "Installing SDN-C core version ${ccsdk.sli.version}"
60 for feature in ${SDNC_CORE_FEATURES}
61 do
62  rm -f /tmp/${feature}-installer*.zip
63 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.core:${feature}-installer:${ccsdk.sli.version}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
64  unzip -d ${featureDir} /tmp/${feature}-installer*zip
65 done
66
67 echo "Installing SDN-C adaptors version ${ccsdk.sli.version}"
68 for feature in ${SDNC_ADAPTORS_FEATURES}
69 do
70  rm -f /tmp/${feature}-installer*.zip
71 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.adaptors:${feature}-installer:${ccsdk.sli.version}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
72  unzip -d ${featureDir} /tmp/${feature}-installer*zip
73 done
74
75 echo "Installing SDN-C northbound version ${sdnc.northbound.version}"
76 for feature in ${SDNC_NORTHBOUND_FEATURES}
77 do
78  rm -f /tmp/${feature}-installer*.zip
79 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
80  unzip -d ${featureDir} /tmp/${feature}-installer*zip
81 done
82
83 echo "Installing SDN-C plugins version ${ccsdk.sli.version}"
84 for feature in ${SDNC_PLUGINS_FEATURES}
85 do
86  rm -f /tmp/${feature}-installer*.zip
87 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.plugins:${feature}-installer:${ccsdk.sli.version}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
88  unzip -d ${featureDir} /tmp/${feature}-installer*zip
89 done
90
91
92
93 echo "Installing platform-logic"
94 rm -f /tmp/platform-logic-installer*.zip
95 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.oam:platform-logic-installer:${sdnc.project.version}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
96 unzip -d ${targetDir} /tmp/platform-logic-installer*.zip
97
98 find ${targetDir} -name '*.sh' -exec chmod +x '{}' \;
99
100 cd $cwd
101