扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
首先在域目录下创建一个名称为deploy的目录,将相关程序放到目录里,然后执行下列脚本。
bash-2.03$ more deploy.sh
#!/bin/sh
#WebLogic Deployer script
#set environment
JAVA_HOME="/data/bea/jdk142_11"
WL_HOME="/data/bea/weblogic816"
LIB_PATH="/data/myCluster/adminServer/lib"
CLASSPATHSEP=:
CLASSPATH=${LIB_PATH}/CommHandle.jar${CLASSPATHSEP}${LIB_PATH}/ocrs12.zip${CLASSPATHSEP}${LIB_PATH}/ojdbc14.jar${CLASSPATHSEP}${LIB_PATH}/common.jar${CLASSPATHSEP}${LIB_PATH}/aciiToString.jar${CLASSPATHSEP}${LIB_PATH}/crypt.jar${CLASSPATHSEP}${LIB_PATH}/commons-beanutils.jar${CLASSPATHSEP}${LIB_PATH}/commons-beanutils-bean-collections.jar${CLASSPATHSEP}${LIB_PATH}/commons-beanutils-core.jar${CLASSPATHSEP}${LIB_PATH}/commons-lang-2.0.jar${CLASSPATHSEP}${LIB_PATH}/commons-logging.jar${CLASSPATHSEP}${LIB_PATH}/commons-logging-api.jar${CLASSPATHSEP}${LIB_PATH}/cncweb.jar${CLASSPATHSEP}${LIB_PATH}/log4j.jar${JAVA_HOME}/lib/tools.jar${CLASSPATHSEP}${WL_HOME}/server${CLASSPATHSEP}${WL_HOME}/server/lib/weblogic_sp.jar${CLASSPATHSEP}${WL_HOME}/server/lib/weblogic.jar
export CLASSPATH
cd /data/myCluster/adminServer
#Deploying Web applications,classes,static files
echo 'Deploying Web applications............'
cp -R ./deploy/DefaultWebApp ./applications
if [ -z "`find ./deploy/DefaultWebApp -name "*.*"|sed 's/\.\/deploy\///'`" ]
then
echo '\tno file will be deployed'
else
for f in `find ./deploy/DefaultWebApp -name "*.*"|sed 's/\.\/deploy\///'`
do
${JAVA_HOME}/bin/java weblogic.Deployer -adminurl http://192.168.0.1:7001\
-username weblogic -password weblogic \
-name DefaultWebApp \
-targets DefaultWebApp@myCluster\
-redeploy $f
done
fi;
echo '\n'
#Deploying application EJB
echo 'Deploying application EJB.............'
if ls ./deploy/|grep jar
then
for i in `ls ./deploy/*.jar|cut -d / -f3|cut -d . -f1`
do
cp ./deploy/$i.jar ./applications
echo 'deploying '$i'.jar'
${JAVA_HOME}/bin/java weblogic.Deployer -adminurl http://192.168.0.1:7001\
-username weblogic -password weblogic \
-name $i \
-targets $i@myCluster\
-redeploy applications/$i.jar
done
else echo '\tno EJB files'
fi
if ls ./deploy/|grep jar
then
rm ./deploy/*.jar
fi
rm -rf ./deploy/DefaultWebApp/*
mkdir -p ./deploy/DefaultWebApp/WEB-INF/classes
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者