aboutsummaryrefslogtreecommitdiffstats
path: root/epsdk-app-onap/src/main/swm/install/postproc/post_proc
blob: 370d44b61d3f61c33c035b44a826fd4fb4c1ce2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
COMMON_SCRIPT=${DIR}/../../common/common.sh

source "${COMMON_SCRIPT}" || {
	echo "ERROR: Common script failed"
	exit 1
}

mkdir -p "${TOMCAT_HOME}/temp"

#Extract the WAR so it can be customized by the localization script
mkdir -p ${ROOT_DIR}/war
cp "${ROOT_DIR}/lib/vid.war" "${ROOT_DIR}/war/${VID_ENDPOINT_NAME}.war"
cd "${ROOT_DIR}/war"
${JAVA_HOME}/bin/jar -xf ${VID_ENDPOINT_NAME}.war
rm ${ROOT_DIR}/war/${VID_ENDPOINT_NAME}.war

LOCALIZE_SCRIPT=$(dirname "$AFTSWM_ACTIONHANDLER_SCRIPT")/../../common/localize.sh


source "${LOCALIZE_SCRIPT}" || {
	echo "ERROR: Localization script failed"
	exit 2
}

#Create the customized WAR and deploy it to Tomcat
mkdir -p "${ROOT_DIR}/deployed"
cd "${ROOT_DIR}/war"
${JAVA_HOME}/bin/jar -cvf "${ROOT_DIR}/deployed/${VID_ENDPOINT_NAME}.war" .
cd
rm -rf "${ROOT_DIR}/war"
mv -f "${ROOT_DIR}/deployed/${VID_ENDPOINT_NAME}.war" "${TOMCAT_HOME}/webapps"

if [ -f "${TOMCAT_HOME}/bin/startup.sh" ]; then
	"${TOMCAT_HOME}/bin/startup.sh"
fi