Browse Source

01wms83-test.sh

master
lizw 3 years ago
parent
commit
530cbb72a4
  1. 20
      05shengke/01wms83-test.sh

20
05shengke/01wms83-test.sh

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

Loading…
Cancel
Save