Adding new ansible adapter to install scripts
[appc/deployment.git] / installation / appc / src / main / scripts / installZips.sh
1 #!/bin/bash
2
3 ###
4 # ============LICENSE_START=======================================================
5 # openECOMP : APP-C
6 # ================================================================================
7 # Copyright (C) 2017 OpenECOMP
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 ###
22
23 if [ -z "$SETTINGS_FILE" -a -z "$GLOBAL_SETTINGS_FILE" -a -s "$HOME"/.m2/settings.xml ]
24 then
25   DEFAULT_MAVEN_SETTINGS=${HOME}/.m2/settings.xml
26   SETTINGS_FILE=${SETTINGS_FILE:-${DEFAULT_MAVEN_SETTINGS}}
27   GLOBAL_SETTINGS_FILE=${GLOBAL_SETTINGS_FILE:-${DEFAULT_MAVEN_SETTINGS}}
28 fi
29
30 APPC_HOME=${APPC_HOME:-/opt/openecomp/appc}
31 SDNC_HOME=${SDNC_HOME:-/opt/openecomp/sdnc}
32
33 targetDir=${1:-${APPC_HOME}}
34 sdnc_targetDir=${1:-${SDNC_HOME}}
35
36 featureDir=${targetDir}/features
37
38 APPC_FEATURES=" \
39  appc-provider \
40  appc-event-listener \
41  appc-dispatcher \
42  appc-chef-adapter \
43  appc-netconf-adapter \
44  appc-rest-adapter \
45  appc-dmaap-adapter \
46  appc-dg-util \
47  appc-metric \
48  appc-dg-shared \
49  appc-asdc-listener \
50  appc-iaas-adapter \
51  appc-ansible-adapter"
52
53 APPC_VERSION=${APPC_VERSION:-0.0.1}
54 APPC_OAM_VERSION=${APPC_OAM_VERSION:-0.1.1}
55
56 if [ ! -d ${targetDir} ]
57 then
58   mkdir -p ${targetDir}
59 fi
60
61 if [ ! -d ${featureDir} ]
62 then
63   mkdir -p ${featureDir}
64 fi
65
66 cwd=$(pwd)
67
68 mavenOpts=${2:-"-s ${SETTINGS_FILE} -gs ${GLOBAL_SETTINGS_FILE}"}
69 cd /tmp
70
71 echo "Installing APP-C version ${APPC_VERSION}"
72 for feature in ${APPC_FEATURES}
73 do
74  rm -f /tmp/${feature}-installer*.zip
75  mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.openecomp.appc:${feature}-installer:${APPC_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
76  unzip -d ${featureDir} /tmp/${feature}-installer*zip
77 done
78
79 echo "Installing platform-logic for APP-C"
80 rm -f /tmp/platform-logic-installer*.zip
81 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.openecomp.appc.deployment:platform-logic-installer:${APPC_OAM_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
82 unzip -d ${targetDir} /tmp/platform-logic-installer*.zip
83
84 find ${targetDir} -name '*.sh' -exec chmod +x '{}' \;
85
86 cd $cwd
87