From 7eaff13e54954fb1f916e00740dc0e37d05279b0 Mon Sep 17 00:00:00 2001 From: lizw Date: Wed, 29 Dec 2021 20:02:44 +0800 Subject: [PATCH] =?UTF-8?q?wms8=20=E6=9C=8D=E5=8A=A1=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms8/build.sh | 90 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/wms8/build.sh b/wms8/build.sh index b51938e..f7f10bc 100644 --- a/wms8/build.sh +++ b/wms8/build.sh @@ -121,51 +121,51 @@ buildCode() { buildCode echo "###--代码构建完成--------------------------------------------------------------------------###" echo "" -# -#logPath=/data3/thinkingwms_nohup.log -#dirPath=/data3/yvan-framework/thinkingwms-ui/thinkingwms-backend/build/libs/ -#serverName=dsl_thinkingwms_ui -# -#cmd=$1 -#profiles=${2:-"test"} -# -##------------------------------------------------------------------- -#JAVA_MEM_OPTS=" -DappName=${serverName} -server -Xmx2g -Xms2g" -#DATABASE_OPTS=" -Ddatabase.codeset=ISO-8859-1 -Ddatabase.logging=false" -#JAVA_OPTS_EXT=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dapplication.codeset=UTF-8 -Dfile.encoding=UTF-8 -Duser.timezone=Asia/Shanghai" -##------------------------------------------------------------------- -# -#startServer() { -# pid=$1 -# if [ -z $pid ];then -# echo -e "$echoPrefix cd $dirPath $echoSuffix" -# cd $dirPath -# echo -e "$echoPrefix java $JAVA_MEM_OPTS $DATABASE_OPTS $JAVA_OPTS_EXT -jar ./thinkingwms-backend-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,$profiles >$logPath 2>&1 & $echoSuffix" -# java $JAVA_MEM_OPTS $DATABASE_OPTS $JAVA_OPTS_EXT -jar ./thinkingwms-backend-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,$profiles >$logPath 2>&1 & -# echo "$serverName 启动成功!" -# else -# echo "$serverName 正在运行..." -# fi -# echo "查看日志: tail -F $logPath -n 100" -#} -# -#stopServer() { -# pid=$1 -# if [ -z $pid ];then -# echo "$serverName 未运行" -# else -# echo -e "$echoPrefix ps -ef | grep "DappName=${serverName}" | grep -v 'grep' | awk '{print \$2}' | xargs kill $echoSuffix" -# ps -ef | grep "DappName=${serverName}" | grep -v 'grep' | awk '{print $2}' | xargs kill -# echo "$serverName 已停止!" -# fi -#} -# -#pid=`ps -ef | grep "DappName=${serverName}" | grep -v 'grep' | awk '{print $2}'` -#if [ ! -z $pid ];then -# stopServer $pid -# sleep 3s -#fi -#startServer + +logPath=/home/www/output/wms8_bench_nohup.log +dirPath=/home/www/deploy/wms8-bench/wms-biz/servo/build/libs/ +serverName=wms8_bench + +cmd=$1 +profiles=${2:-"test"} + +#------------------------------------------------------------------- +JAVA_MEM_OPTS=" -DappName=${serverName} -server -Xmx2g -Xms2g" +DATABASE_OPTS=" -Ddatabase.codeset=ISO-8859-1 -Ddatabase.logging=false" +JAVA_OPTS_EXT=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dapplication.codeset=UTF-8 -Dfile.encoding=UTF-8 -Duser.timezone=Asia/Shanghai" +#------------------------------------------------------------------- + +startServer() { + pid=$1 + if [ -z $pid ];then + echo -e "$echoPrefix cd $dirPath $echoSuffix" + cd $dirPath + echo -e "$echoPrefix java $JAVA_MEM_OPTS $DATABASE_OPTS $JAVA_OPTS_EXT -jar ./servo-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,$profiles >$logPath 2>&1 & $echoSuffix" + java $JAVA_MEM_OPTS $DATABASE_OPTS $JAVA_OPTS_EXT -jar ./servo-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,$profiles >$logPath 2>&1 & + echo "$serverName 启动成功!" + else + echo "$serverName 正在运行..." + fi + echo "查看日志: tail -F $logPath -n 100" +} + +stopServer() { + pid=$1 + if [ -z $pid ];then + echo "$serverName 未运行" + else + echo -e "$echoPrefix ps -ef | grep "DappName=${serverName}" | grep -v 'grep' | awk '{print \$2}' | xargs kill $echoSuffix" + ps -ef | grep "DappName=${serverName}" | grep -v 'grep' | awk '{print $2}' | xargs kill + echo "$serverName 已停止!" + fi +} + +pid=`ps -ef | grep "DappName=${serverName}" | grep -v 'grep' | awk '{print $2}'` +if [ ! -z $pid ];then + stopServer $pid + sleep 3s +fi +startServer # bash <(curl -s http://git.yvanui.com/lizhiwei/jztd-deploy/raw/master/wms8/build.sh)