From 12479cffd24e894514c034c0a7fb7e0c28ab5324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AD=E5=A6=82?= <8775@163.com> Date: Mon, 23 Dec 2024 11:45:47 +0800 Subject: [PATCH] 5.0 --- .gitignore | 1 + build-admin.sh | 2 ++ build-gateway.sh | 2 ++ build-website.sh | 2 ++ script/startup.sh | 21 +++++++++++++++++++ .../src/main/resources/application.properties | 6 +++++- .../src/main/resources/application.properties | 4 ++++ .../src/main/resources/application.properties | 5 ++++- 8 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 script/startup.sh diff --git a/.gitignore b/.gitignore index 18ccf36e..3f1a8977 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ target/ +logs/ !.mvn/wrapper/maven-wrapper.jar ### STS ### diff --git a/build-admin.sh b/build-admin.sh index a11191ec..1236cdc4 100755 --- a/build-admin.sh +++ b/build-admin.sh @@ -45,5 +45,7 @@ cp -r ${front_source}/dist ./$target_dir # 复制服务端资源 cp -r ${server_source}/target/*.jar $target_dir +cp -r script/* $target_dir +cp -r ${server_source}/src/main/resources/application-test.properties $target_dir echo "服务端构建完毕,构建结果在${target_dir}文件夹下" diff --git a/build-gateway.sh b/build-gateway.sh index 0aed5357..7c4bd83d 100644 --- a/build-gateway.sh +++ b/build-gateway.sh @@ -33,5 +33,7 @@ rm -rf ${target_dir}/* # 复制服务端资源 cp -r ${server_source}/target/*.jar $target_dir +cp -r script/* $target_dir +cp -r ${server_source}/src/main/resources/application-test.properties $target_dir echo "服务端构建完毕,构建结果在${target_dir}文件夹下" diff --git a/build-website.sh b/build-website.sh index bd69b2c5..1296c61c 100755 --- a/build-website.sh +++ b/build-website.sh @@ -45,5 +45,7 @@ cp -r ${front_source}/dist ./$target_dir # 复制服务端资源 cp -r ${server_source}/target/*.jar $target_dir +cp -r script/* $target_dir +cp -r ${server_source}/src/main/resources/application-test.properties $target_dir echo "服务端构建完毕,构建结果在${target_dir}文件夹下" diff --git a/script/startup.sh b/script/startup.sh new file mode 100644 index 00000000..f93999ca --- /dev/null +++ b/script/startup.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# 执行文件名称 +app_name=${1} + +if [ -z "${1}" ];then + echo "未指定应用程序参数,格式:sh startup.sh xxx.jar" + exit 0 +fi + +echo "启动程序:${app_name}" + +# 先关闭服务 +pid=$(ps -ef | grep $app_name | grep -v grep | awk '{print $2}') +if [ -n "$pid" ]; then + echo "stop $app_name, pid:$pid" + kill -9 "$pid" +fi + + +nohup java -server -jar -Dspring.profiles.active=test -Duser.timezone=Asia/Shanghai -Xms512m -Xmx512m $app_name >/dev/null 2>&1 & diff --git a/sop-admin/sop-admin-backend/admin-boot/src/main/resources/application.properties b/sop-admin/sop-admin-backend/admin-boot/src/main/resources/application.properties index dfa98f82..853db1bf 100755 --- a/sop-admin/sop-admin-backend/admin-boot/src/main/resources/application.properties +++ b/sop-admin/sop-admin-backend/admin-boot/src/main/resources/application.properties @@ -41,8 +41,12 @@ mybatis.fill.com.gitee.sop.admin.common.fill.UpdateByFill= mybatis.config-location=classpath:mybatis/mybatisConfig.xml mybatis.mapper-locations=classpath:mybatis/mapper/*.xml - +# log level +logging.level.com.gitee.sop=info +# log path +logging.file.name=logs/sop-admin.log # print SQL logging.level.com.gitee.sop.admin.dao=error logging.level.com.gitee.fastmybatis=info mybatis.print-sql=false + diff --git a/sop-gateway/src/main/resources/application.properties b/sop-gateway/src/main/resources/application.properties index a435e472..9d29759d 100755 --- a/sop-gateway/src/main/resources/application.properties +++ b/sop-gateway/src/main/resources/application.properties @@ -92,6 +92,10 @@ mybatis.config-location=classpath:mybatis/mybatisConfig.xml # print sql, true/false mybatis.print-sql=false +# log level +logging.level.com.gitee.sop=info +# log path +logging.file.name=logs/sop-gateway.log # print SQL logging.level.com.gitee.sop.gateway.dao=error logging.level.com.gitee.fastmybatis=info diff --git a/sop-website/sop-website-backend/website-boot/src/main/resources/application.properties b/sop-website/sop-website-backend/website-boot/src/main/resources/application.properties index 056a1452..14860bff 100755 --- a/sop-website/sop-website-backend/website-boot/src/main/resources/application.properties +++ b/sop-website/sop-website-backend/website-boot/src/main/resources/application.properties @@ -21,7 +21,10 @@ mybatis.fill.com.gitee.fastmybatis.core.support.LocalDateTimeFillUpdate=update_t mybatis.config-location=classpath:mybatis/mybatisConfig.xml mybatis.mapper-locations=classpath:mybatis/mapper/*.xml - +# log level +logging.level.com.gitee.sop=info +# log path +logging.file.name=logs/sop-website.log # print SQL logging.level.com.gitee.sop.website.dao=error logging.level.com.gitee.fastmybatis=info