Deployment onap rename
[appc/deployment.git] / installation / appc / src / main / scripts / installZips.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 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 APPC_HOME=${APPC_HOME:-/opt/onap/appc}
32 SDNC_HOME=${SDNC_HOME:-/opt/onap/sdnc}
33
34 targetDir=${1:-${APPC_HOME}}
35 sdnc_targetDir=${1:-${SDNC_HOME}}
36
37 featureDir=${targetDir}/features
38
39 APPC_FEATURES=" \
40  appc-sdc-listener \
41  appc-lifecycle-management \
42  appc-command-executor \
43  appc-provider \
44  appc-event-listener \
45  appc-dispatcher \
46  appc-chef-adapter \
47  appc-netconf-adapter \
48  appc-rest-adapter \
49  appc-dmaap-adapter \
50  appc-dg-util \
51  appc-metric \
52  appc-dg-shared \
53  appc-iaas-adapter \
54  appc-ansible-adapter \
55  appc-oam \
56  appc-sequence-generator \
57  appc-config-generator \
58  appc-config-data-services \
59  appc-artifact-handler \
60  appc-config-adaptor \
61  appc-config-audit \
62  appc-config-encryption-tool \
63  appc-config-flow-controller \
64  appc-config-params \
65  appc-aai-client"
66
67 APPC_VERSION=${APPC_VERSION:-0.0.1}
68 APPC_OAM_VERSION=${APPC_OAM_VERSION:-0.1.1}
69
70 if [ ! -d ${targetDir} ]
71 then
72   mkdir -p ${targetDir}
73 fi
74
75 if [ ! -d ${featureDir} ]
76 then
77   mkdir -p ${featureDir}
78 fi
79
80 cwd=$(pwd)
81
82 mavenOpts=${2:-"-s ${SETTINGS_FILE} -gs ${GLOBAL_SETTINGS_FILE}"}
83 cd /tmp
84
85 echo "Installing APP-C version ${APPC_VERSION}"
86 for feature in ${APPC_FEATURES}
87 do
88  rm -f /tmp/${feature}-installer*.zip
89  mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.appc:${feature}-installer:${APPC_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
90  unzip -d ${featureDir} /tmp/${feature}-installer*zip
91 done
92
93 echo "Installing platform-logic for APP-C"
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.appc.deployment:platform-logic-installer:${APPC_OAM_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 echo "Downloading dg-loader-provider jar from nexus"
99 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.appc.plugins:dg-loader-provider:${APPC_VERSION}:jar:jar-with-dependencies -DoutputDirectory=${targetDir}/data
100 mv ${targetDir}/data/dg-loader-provider-*-jar-with-dependencies.jar ${targetDir}/data/dg-loader-provider-jar-with-dependencies.jar
101
102 find ${targetDir} -name '*.sh' -exec chmod +x '{}' \;
103
104 cd $cwd
105