Docker changes for dmaap microservice
[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-2019 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:-${APPC_HOME}}
34 sdnc_targetDir=${1:-${SDNC_HOME}}
35
36 #The featureDir holds the install-feature shell scripts for each feature
37 featureDir=$2/featureDir
38
39 #The repoDir is where the classes are extracted to. This will be merged with the opendaylight
40 #  system directory.
41 repoDir=$2/repoDir
42
43
44 APPC_FEATURES=" \
45  appc-core \
46  appc-sdc-listener \
47  appc-lifecycle-management \
48  appc-provider \
49  appc-dispatcher \
50  appc-chef-adapter \
51  appc-netconf-adapter \
52  appc-rest-adapter \
53  appc-dg-util \
54  appc-metric \
55  appc-dg-shared \
56  appc-iaas-adapter \
57  appc-ansible-adapter \
58  appc-oam \
59  appc-sequence-generator \
60  appc-config-generator \
61  appc-config-data-services \
62  appc-artifact-handler \
63  appc-config-adaptor \
64  appc-config-audit \
65  appc-config-encryption-tool \
66  appc-config-flow-controller \
67  appc-config-params \
68  appc-aai-client \
69  appc-network-inventory-client \
70  appc-design-services \
71  appc-interfaces-service \
72  appc-service-communicator"
73
74
75 APPC_VERSION=${APPC_VERSION:-0.0.1}
76 APPC_CDT_VERSION=${APPC_CDT_VERSION:-0.0.1}
77 APPC_OAM_VERSION=${APPC_OAM_VERSION:-0.1.1}
78 #AAF_SHIRO_VERSION=${AAF_SHIRO_VERSION:-2.1.7-SNAPSHOT}
79
80 tmpDir=/tmp/appc-${APPC_VERSION}
81
82 if [ ! -d ${targetDir} ]
83 then
84   mkdir -p ${targetDir}
85 fi
86
87 if [ ! -d ${tmpDir} ]
88 then
89   mkdir -p ${tmpDir}
90 fi
91
92 cwd=$(pwd)
93
94 mavenOpts="-s ${SETTINGS_FILE} -gs ${GLOBAL_SETTINGS_FILE}"
95 cd ${tmpDir}
96
97 echo "Installing APP-C version ${APPC_VERSION}"
98 for feature in ${APPC_FEATURES}
99 do
100   rm -f ${tmpDir}/${feature}-installer*.zip
101   mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.appc:${feature}-installer:${APPC_VERSION}:zip -DoutputDirectory=${tmpDir} -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
102   unzip -d ${featureDir} ${tmpDir}/${feature}-installer*zip
103   unzip -n -d ${repoDir} ${featureDir}/${feature}/${feature}*zip
104   rm -f ${featureDir}/${feature}/${feature}*zip
105 done
106
107 echo "Installing platform-logic for APP-C"
108 rm -f ${tmpDir}/platform-logic-installer*.zip
109 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=${tmpDir} -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true
110 unzip -d ${targetDir} ${tmpDir}/platform-logic-installer*.zip
111
112 echo "Downloading dg-loader DGs from nexus"
113 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.appc:appc-dg-provider:${APPC_VERSION} -DoutputDirectory=${tmpDir}
114 unzip -d ${targetDir}/svclogic/graphs/appc/json ${tmpDir}/appc-dg-provider*.jar json/**
115 mv ${targetDir}/svclogic/graphs/appc/json/json ${targetDir}/svclogic/graphs/appc/json/dg-loader-dgs
116
117 echo "Downloading dg-loader-provider jar from nexus"
118 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
119 mv ${targetDir}/data/dg-loader-provider-*-jar-with-dependencies.jar ${targetDir}/data/dg-loader-provider-jar-with-dependencies.jar
120
121 # installed from CCSDK in El Alto release
122 #echo "Downloading aaf-cadi-shiro from nexus"
123 #mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.aaf.cadi:aaf-shiro-aafrealm-osgi-bundle:${AAF_SHIRO_VERSION} -DoutputDirectory=${targetDir}/data
124 #mv ${targetDir}/data/aaf-shiro-aafrealm-osgi-bundle-*.jar ${targetDir}/data/aaf-shiro-aafrealm-osgi-bundle.jar
125
126 echo "Setting keyfile to readonly"
127 chmod 400 ${targetDir}/data/stores/org.onap.appc.keyfile
128
129 echo "Downloading CDT Proxy Jar from nexus"
130 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.appc.cdt:cdt-proxy-service:${APPC_CDT_VERSION} -DoutputDirectory=${targetDir}/cdt-proxy-service
131 mv ${targetDir}/cdt-proxy-service/cdt-proxy-service-*.jar ${targetDir}/cdt-proxy-service/cdt-proxy-service.jar
132
133 echo "Downloading Dmaap Service Jar from nexus"
134 mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.appc.services.dmaap:dmaap-event-service:1.7.0-SNAPSHOT -DoutputDirectory=${targetDir}/dmaap-event-service
135 mv ${targetDir}/dmaap-event-service/dmaap-event-service-*.jar ${targetDir}/dmaap-event-service/dmaap-event-service.jar
136
137 find ${targetDir} -name '*.sh' -exec chmod +x '{}' \;
138
139 cd $cwd
140