Commit 08b09131 authored by lijing's avatar lijing

添加配置分离

parent b7add199
#!/bin/bash
#引入环境变量
export YBS_SCIENCE_HOME=/home/data/jar
#运行目录
rundir=""
case $1 in
ybs-science)
rundir=science
;;
*)
echo "输入参数$1有误,请重试!!"
exit
;;
esac
#当前运行jar包绝对路径
runPath=$YBS_SCIENCE_HOME/$rundir/run
#移动
sudo mv ~/$1.jar $YBS_SCIENCE_HOME/$rundir/pub/
#备份
bakJarName=`date +%Y%m%d%H:%M:%S`
sudo mkdir $YBS_SCIENCE_HOME/$rundir/bak/$bakJarName
sudo mv $runPath/* $YBS_SCIENCE_HOME/$rundir/bak/$bakJarName/
#放包
sudo mv $YBS_SCIENCE_HOME/$rundir/pub/* $runPath/
runjar=`ls $runPath`
if [[ -z $runjar ]]; then
echo "找不到"$1"的jar包,请检查jar是否存在. shell脚本退出"
exit
fi
#得到服务pid
server=`sudo ps -ef | grep java | grep $1 |grep nohup | grep -v grep | awk '{print $2}'`
if [[ $server -gt 0 ]]; then
echo "运行服务列表中存在"$1"服务,正在关停..."
sudo ps -ef | grep java | grep $1 |grep -v grep | awk '{print $2}' |xargs sudo kill -9
sleep 3
echo "关停成功"
fi
cd $runPath
sudo nohup java -jar $runjar > /dev/null 2>&1 &
sleep 3s
echo "启动成功,请查看控制台日志确认"
\ No newline at end of file
......@@ -134,7 +134,29 @@
</dependency>
</dependencies>
<profiles>
<profile>
<id>local</id>
<properties>
<profileActive>local</profileActive>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>test</id>
<properties>
<profileActive>test</profileActive>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<profileActive>prod</profileActive>
</properties>
</profile>
</profiles>
<repositories>
<repository>
<id>central</id>
......
#贵州省卫生健康科研项目管理系统(本地环境)
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://ybs01beta.mysql.rds.aliyuncs.com/yn_srp_system?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=Asia/Shanghai
username: yn_kysb
password: '&Zk4obO7v@'
redis:
# 超时时间
timeout: 10000ms
# 服务器地址
host: 192.168.1.95
# 服务器端口
port: 6379
# 数据库
database: 4
# 密码
password: Ynbys2@)@)
lettuce:
pool:
# 最大连接数(默认8)
max-active: 1024
# 最大连接阻塞等待时间,默认-1
max-wait: 10000ms
# 最大空闲连接
max-idle: 200
# 最小空闲连接
min-idle: 2
#贵州省卫生健康科研项目管理系统(本地环境)
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://ybs01beta.mysql.rds.aliyuncs.com/yn_srp_system?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=Asia/Shanghai
username: yn_kysb
password: '&Zk4obO7v@'
redis:
# 超时时间
timeout: 10000ms
# 服务器地址
host: 192.168.1.95
# 服务器端口
port: 6379
# 数据库
database: 4
# 密码
password: Ynbys2@)@)
lettuce:
pool:
# 最大连接数(默认8)
max-active: 1024
# 最大连接阻塞等待时间,默认-1
max-wait: 10000ms
# 最大空闲连接
max-idle: 200
# 最小空闲连接
min-idle: 2
#内蒙卫生健康科研项目管理系统(测试环境)
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://ybs01beta.mysql.rds.aliyuncs.com/yn_srp_system?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=Asia/Shanghai
username: yn_kysb
password: '&Zk4obO7v@'
redis:
# 超时时间
timeout: 10000ms
# 服务器地址
host: 192.168.1.23
# 服务器端口
port: 6379
# 数据库
database: 4
# 密码
password: 123456
lettuce:
pool:
# 最大连接数(默认8)
max-active: 1024
# 最大连接阻塞等待时间,默认-1
max-wait: 10000ms
# 最大空闲连接
max-idle: 200
# 最小空闲连接
min-idle: 5
......@@ -8,8 +8,7 @@ spring:
application:
name: science-admin
profiles:
# active: '@profiles.active@'
active: 'local'
active: @profileActive@
http:
encoding:
force: true
......@@ -62,130 +61,9 @@ swagger:
basePackage: com.yiboshi.science.rest.v1
globalHeader: true
---
#贵州省卫生健康科研项目管理系统(本地环境)
spring:
profiles: local
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://ybs01beta.mysql.rds.aliyuncs.com/yn_srp_system?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=Asia/Shanghai
username: yn_kysb
password: '&Zk4obO7v@'
redis:
# 超时时间
timeout: 10000ms
# 服务器地址
host: 192.168.1.95
# 服务器端口
port: 6379
# 数据库
database: 4
# 密码
password: Ynbys2@)@)
lettuce:
pool:
# 最大连接数(默认8)
max-active: 1024
# 最大连接阻塞等待时间,默认-1
max-wait: 10000ms
# 最大空闲连接
max-idle: 200
# 最小空闲连接
min-idle: 2
---
#内蒙卫生健康科研项目管理系统(测试环境)
spring:
profiles: test
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://ybs01beta.mysql.rds.aliyuncs.com/yn_srp_system?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=Asia/Shanghai
username: yn_kysb
password: '&Zk4obO7v@'
redis:
# 超时时间
timeout: 10000ms
# 服务器地址
host: 192.168.1.23
# 服务器端口
port: 6379
# 数据库
database: 4
# 密码
password: 123456
lettuce:
pool:
# 最大连接数(默认8)
max-active: 1024
# 最大连接阻塞等待时间,默认-1
max-wait: 10000ms
# 最大空闲连接
max-idle: 200
# 最小空闲连接
min-idle: 5
---
#贵州省卫生健康科研项目管理系统(开发环境)
spring:
profiles: dev
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://ybs01beta.mysql.rds.aliyuncs.com/yn_srp_system?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=Asia/Shanghai
username: yn_kysb
password: '&Zk4obO7v@'
redis:
# 超时时间
timeout: 10000ms
# 服务器地址
host: beta-reids-pub.redis.rds.aliyuncs.com
# 服务器端口
port: 6379
# 数据库
database: 4
# 密码
password: yn_kysb:&Zk4obO7v@
lettuce:
pool:
# 最大连接数(默认8)
max-active: 1024
# 最大连接阻塞等待时间,默认-1
max-wait: 10000ms
# 最大空闲连接
max-idle: 200
# 最小空闲连接
min-idle: 5
---
#贵州省卫生健康科研项目管理系统(生成环境)
spring:
profiles: prod
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://nmg-kysb.mysql.rds.aliyuncs.com/yn_srp_system?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=Asia/Shanghai
username: yhbj_yn
password: 'WpKJS2ZEx&35DrU'
redis:
# 超时时间
timeout: 10000ms
# 服务器地址
host: nmg-kysb.redis.rds.aliyuncs.com
# 服务器端口
port: 6379
# 数据库
database: 7
# 密码
password: yhbj_yn:WpKJS2ZEx&35DrU
lettuce:
pool:
# 最大连接数(默认8)
max-active: 1024
# 最大连接阻塞等待时间,默认-1
max-wait: 10000ms
# 最大空闲连接
max-idle: 200
# 最小空闲连接
min-idle: 5
---
# 登录相关配置
verification:
# 验证码
......
......@@ -37,7 +37,7 @@
</logger>
</springProfile>
<springProfile name="dev,test">
<springProfile name="test">
<logger name="com.yiboshi" level="debug" additivity="false">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment