lizw há 3 anos atrás
pai
commit
455ac069d0
1 ficheiros alterados com 9 adições e 7 exclusões
  1. 9 7
      yxt/deploy-lims-report.sh

+ 9 - 7
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