Browse Source

01wms83-test.sh

lizw 2 năm trước cách đây
mục cha
commit
530cbb72a4
1 tập tin đã thay đổi với 15 bổ sung7 xóa
  1. 15 7
      05shengke/01wms83-test.sh

+ 15 - 7
05shengke/01wms83-test.sh

@@ -161,10 +161,11 @@ deployPull() {
 
 deployServer() {
   pid=$1
+  start=$2
   deployPull
   buildCode
   echo "###--代码构建完成--------------------------------------------------------------------------###"
-  # 重启服务
+  # 停止服务
   if [ ! -z $pid ];then
     stopServer $pid
     sleep 8s
@@ -177,7 +178,10 @@ deployServer() {
   echo -e "$echoPrefix cp -r ./ ../runtime $echoSuffix"
   cp -r ./ ../runtime
   echo ""
-  startServer
+  # 启动服务
+  if [ "$start" == "start" ];then
+    startServer
+  fi
 }
 
 restartServer() {
@@ -199,16 +203,19 @@ deployYvanUI() {
 }
 
 pid=`ps -ef | grep "DappName=${serverName}" | grep -v 'grep' | awk '{print $2}'`
-# 操作参数: pull deploy restart start stop kill log logs
+# 操作参数: pull build deploy restart start stop kill log logs
 if [ "$cmd" == "pull" ];then
   deployYvanUI
   deployPull
   if [ -z $pid ];then
-    echo "$serverName 未运行 | 输入操作参数: pull deploy restart start stop kill log logs"
+    echo "$serverName 未运行 | 输入操作参数: pull build deploy restart start stop kill log logs"
   fi
+elif [ "$cmd" == "build" ];then
+  deployYvanUI
+  deployServer $pid "no_start"
 elif [ "$cmd" == "deploy" ];then
   deployYvanUI
-  deployServer $pid
+  deployServer $pid "start"
 elif [ "$cmd" == "restart" ];then
   restartServer $pid
 elif [ "$cmd" == "start" ];then
@@ -219,9 +226,10 @@ elif [ "$cmd" == "log" ] || [ "$cmd" == "logs" ];then
   logs
 else
   if [ -z $pid ];then
-    echo "$serverName 未运行 | 输入操作参数: pull deploy restart start stop kill log logs"
+    echo "$serverName 未运行 | 输入操作参数: pull build deploy restart start stop kill log logs"
+    echo "查看日志: tail -F $logPath -n 100"
   else
-    echo "输入操作参数: pull deploy restart start stop kill log logs"
+    echo "输入操作参数: pull build deploy restart start stop kill log logs"
     echo "pid=$pid | $serverName 正在运行... | 查看日志: tail -F $logPath -n 100"
   fi
 fi