From 530cbb72a4c23f8f27a4296065648fa58a8faedf Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Fri, 10 Feb 2023 11:49:17 +0800 Subject: [PATCH] 01wms83-test.sh --- 05shengke/01wms83-test.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/05shengke/01wms83-test.sh b/05shengke/01wms83-test.sh index e575fa4..d1d74cc 100644 --- a/05shengke/01wms83-test.sh +++ b/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