From 455ac069d0b1f5827fd95feb0fbb26b6beb85243 Mon Sep 17 00:00:00 2001 From: lizw Date: Thu, 16 Dec 2021 13:43:28 +0800 Subject: [PATCH] ... --- yxt/deploy-lims-report.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/yxt/deploy-lims-report.sh b/yxt/deploy-lims-report.sh index 301651b..3f81ab4 100644 --- a/yxt/deploy-lims-report.sh +++ b/yxt/deploy-lims-report.sh @@ -8,6 +8,8 @@ dirPath=~/deploy/yxt_lmis_report serverName=yxt_lmis_report logPath=~/logs/yxt_lmis_report_nohup.log +cmd=$1 +profiles=${2:-"hwy"} echoPrefix="\033[36m+" echoSuffix="\033[0m" @@ -59,8 +61,8 @@ startServer() { 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 ./app-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,hwy --server.port=8086 >$logPath 2>&1 & $echoSuffix" - java $JAVA_MEM_OPTS $DATABASE_OPTS $JAVA_OPTS_EXT -jar ./app-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,hwy --server.port=8086 $logPath 2>&1 & + echo -e "$echoPrefix java $JAVA_MEM_OPTS $DATABASE_OPTS $JAVA_OPTS_EXT -jar ./app-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,$profiles --server.port=8086 >$logPath 2>&1 & $echoSuffix" + java $JAVA_MEM_OPTS $DATABASE_OPTS $JAVA_OPTS_EXT -jar ./app-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,$profiles --server.port=8086 $logPath 2>&1 & echo "$serverName 启动成功!" else echo "$serverName 正在运行..." @@ -104,15 +106,15 @@ logs() { pid=`ps -ef | grep "DappName=${serverName}" | grep -v 'grep' | awk '{print $2}'` # 操作参数: pull deploy start stop kill log logs -if [ "$1" == "pull" ];then +if [ "$cmd" == "pull" ];then deployPull $pid -elif [ "$1" == "deploy" ];then +elif [ "$cmd" == "deploy" ];then deployServer $pid -elif [ "$1" == "start" ];then +elif [ "$cmd" == "start" ];then startServer $pid -elif [ "$1" == "stop" ] || [ "$1" == "kill" ];then +elif [ "$cmd" == "stop" ] || [ "$cmd" == "kill" ];then stopServer $pid -elif [ "$1" == "log" ] || [ "$1" == "logs" ];then +elif [ "$cmd" == "log" ] || [ "$cmd" == "logs" ];then logs else if [ -z $pid ];then