-
Notifications
You must be signed in to change notification settings - Fork 6
/
build-archive.sh
executable file
·29 lines (26 loc) · 1.11 KB
/
build-archive.sh
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
#!/bin/sh
#
#Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
#
#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
# This script requires the following environment variables:
#
# JAVA_HOME - The location of the JDK to use. The caller must set
# this variable to a valid Java 8 (or later) JDK.
#
if [ -z ${JAVA_HOME} ] || [ ! -e ${JAVA_HOME}/bin/jar ]; then
echo "JAVA_HOME must be set to version of a java JDK 1.8 or greater"
exit 1
fi
echo JAVA_HOME=${JAVA_HOME}
scriptDir="$( cd "$( dirname $0 )" && pwd )"
if [ ! -d ${scriptDir} ]; then
echo "Unable to determine the sample directory where the application is found"
echo "Using shell /bin/sh to determine and found ${scriptDir}"
exit 1
fi
rm -Rf ${scriptDir}/archive
mkdir -p ${scriptDir}/archive/wlsdeploy/applications
${JAVA_HOME}/bin/jar cvf ${scriptDir}/archive/wlsdeploy/applications/opdemo.war -C ${scriptDir}/opdemo WEB-INF -C ${scriptDir}/opdemo index.jsp
${JAVA_HOME}/bin/jar cvf ${scriptDir}/archive.zip -C ${scriptDir}/archive wlsdeploy