Files
crmeb_java/crmeb/start.sh
stivepeim 0d32da772d 圣诞快乐
# v1.3 更新列表
    1. 【新增】砍价
	2. 【新增】拼团
	3. 【新增】一号通
	4. 【修复】商品sku 编辑时出现商品属性对应错误的问题
	5. 【修复】商品推广海报生成二维码可能会出错的问题【小程序调试中】
	6. 【修复】微信公众号和小程序头像可能获取不到的问题
	7. 【修复】下单时可能会出错的问题
	8. 【修复】pc管理端用户访问量
	9. 【修复】微信退款
	10. 【修复】管理端订单状态可能出现不正确的情况
	11. 【修复】WEB管理端-菜单色调,短信API更新,首页用户访问量,系统设置tab是自动选择下一及表单
	12. 【修复】系统设置出现更新不正确的问题
2020-12-23 15:56:45 +08:00

127 lines
3.1 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
#开始时间 时间戳
startTime=`date +'%Y-%m-%d %H:%M:%S'`
#接口项目站点路径(目录按照各自配置)
APP_PATH=/www/wwwroot/api.java.crmeb.net
#APP_PATH=/Library/WebServer/Documents/zhongbang/java/crmeb/target
#jar包文件名称
APP_NAME=$APP_PATH/Crmeb.jar
#日志文件名称
LOG_FILE=$APP_PATH/crmeb_out.log
#启动环境 # 如果需要配置数据和redis请在 application-prod.yml中修改, 用jar命令修改即可
APP_YML=--spring.profiles.active=prod
#数据库配置
rm -rf $LOG_FILE
echo "开始停止 Crmeb 项目进程"
#查询进程并杀掉当前jar/java程序
pid=`ps -ef|grep $APP_NAME | grep -v grep | awk '{print $2}'`
if [ $pid ];then
echo "pid: $pid"
kill -9 $pid
echo "Crmeb 项目进程进程终止成功"
fi
sleep 2
#判断jar包文件是否存在如果存在启动jar包并时时查看启动日志
if test -e $APP_NAME;then
echo '文件存在,开始启动此程序...'
# 启动jar包指向日志文件2>&1 & 表示打开或指向同一个日志文件 --spring.profiles.active=prod 启动 prod环境
nohup java -jar $APP_NAME $APP_YML > crmeb_out.log 2>&1 &
echo "正在发布中,请稍后......"
sleep 10s
#通过检测日志来判断
while [ -f $LOG_FILE ]
do
success=`grep "Started CrmebApplication in " $LOG_FILE`
if [[ "$success" != "" ]]
then
# echo "Crmeb start ........."
break
else
# echo "Crmeb Running ......."
sleep 1s
fi
# echo "开始检测启动失败标记"
fail=`grep "Fail" $LOG_FILE`
if [[ "$fail" != "" ]]
then
echo "项目启动失败"
tail -f $LOG_FILE
break
else
# echo "Crmeb Running ......."
sleep 1s
fi
done
echo "Crmeb Started Success"
endTime=`date +'%Y-%m-%d %H:%M:%S'`
startSecond=$(date --date="$startTime" +%s);
endSecond=$(date --date="$endTime" +%s);
total=$((endSecond-startSecond))
# shellcheck disable=SC2027
echo "本次运行时间: "$total"s"
# shellcheck disable=SC2086
echo "当前时间:"$endTime
# #消息推送到企业微信群
# curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4f7df494-cece-49c2-8e04-60610c937b4a' \
# -H 'Content-Type: application/json' \
# -d '
# {
# "msgtype": "text",
# "text": {
# "content": "Api项目部署成功\n 耗时:'$total's \n 当前时间:'"$endTime"'",
# "mentioned_list":["@all"]
# }
# }'
##实时查看启动日志
# #tail -f $LOG_FILE
# pid1=;
# while [[ $pid1 = "" ]]
# do
# sleep 5
# pid1=`ps -ef|grep $APP_NAME | grep -v grep | awk '{print $2}'`
# done
#
# sleep 5
# echo "发布成功!"
#
# #消息推送到企业微信群
# curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4f7df494-cece-49c2-8e04-60610c937b4a' \
# -H 'Content-Type: application/json' \
# -d '
# {
# "msgtype": "text",
# "text": {
# "content": "Api项目部署成功",
# "mentioned_list":["@all"]
# }
# }'
else
echo '$APP_NAME 文件不存在,请检查。'
fi
#在 $APP_NAME 同级目录下运行 ./start.sh 命令即可启动项目。