Allow cdt port to be set
[appc/deployment.git] / cdt / src / main / scripts / installZips.sh
1 #!/bin/bash
2
3 ###
4 # ============LICENSE_START=======================================================
5 # APPC
6 # ================================================================================
7 # Copyright (C) 2018 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 ###
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/onap/appc}
31 SDNC_HOME=${SDNC_HOME:-/opt/onap/sdnc}
32
33 targetDir=${1}
34 sdnc_targetDir=${1}
35
36
37
38 APPC_VERSION=${APPC_VERSION:-0.0.1}
39 APPC_OAM_VERSION=${APPC_OAM_VERSION:-0.1.1}
40
41 if [ ! -d ${targetDir} ]
42 then
43   mkdir -p ${targetDir}
44 fi
45
46 cwd=$(pwd)
47
48 mavenOpts="-s ${SETTINGS_FILE} -gs ${GLOBAL_SETTINGS_FILE}"
49 cd /tmp
50
51
52
53 echo "Downloading cdt code from nexus"
54 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.appc.cdt:config-design-tool:${APPC_VERSION}:zip -DoutputDirectory=/tmp
55 unzip -d ${targetDir}/config-design-tool /tmp/config-design-tool*.zip
56
57 find ${targetDir} -name '*.sh' -exec chmod +x '{}' \;
58
59 cd $cwd
60