refactor(deploy): 迁移CI/CD至双服务器架构
- Jenkinsfile: Registry改为Infra内网172.17.16.7:5000,部署目标改为Prod内网172.17.16.14 - docker-compose: 镜像源改为172.17.16.7:5000,MySQL改为172.17.16.8,Redis改为172.17.16.13,RocketMQ改为腾讯云TDMQ - 所有模块application-prod.yaml: 统一更新MySQL/Redis/RocketMQ默认连接地址 - deploy.sh: Registry地址同步更新 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,206 +1,206 @@
|
||||
--- #################### 注册中心 + 配置中心相关配置 ####################
|
||||
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: ${NACOS_ADDR:127.0.0.1:8848}
|
||||
username: ${NACOS_USERNAME:nacos}
|
||||
password: ${NACOS_PASSWORD:nacos}
|
||||
discovery:
|
||||
namespace: ${NACOS_DISCOVERY_NAMESPACE:prod}
|
||||
group: DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0
|
||||
config:
|
||||
namespace: ${NACOS_CONFIG_NAMESPACE:prod}
|
||||
group: DEFAULT_GROUP
|
||||
file-extension: yaml
|
||||
refresh-enabled: true
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
spring:
|
||||
datasource:
|
||||
druid: # Druid 【监控】相关的全局配置
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
allow: # 设置白名单,不填则允许所有访问
|
||||
url-pattern: /druid/*
|
||||
login-username: ${DRUID_USERNAME:admin}
|
||||
login-password: ${DRUID_PASSWORD:admin}
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
log-slow-sql: true # 慢 SQL 记录
|
||||
slow-sql-millis: 100
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
dynamic: # 多数据源配置
|
||||
druid: # Druid 【连接池】相关的全局配置
|
||||
initial-size: 5
|
||||
min-idle: 10
|
||||
max-active: 20
|
||||
max-wait: 60000
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 600000
|
||||
max-evictable-idle-time-millis: 1800000
|
||||
validation-query: SELECT 1 FROM DUAL
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
pool-prepared-statements: true
|
||||
max-pool-prepared-statement-per-connection-size: 20
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://127.0.0.1:3306/aiot_platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: root
|
||||
slave: # 从库配置(可选)
|
||||
lazy: true
|
||||
url: jdbc:mysql://127.0.0.1:3306/aiot_platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: root
|
||||
|
||||
# Redis 配置
|
||||
data:
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
database: 0
|
||||
password: ""
|
||||
timeout: 5000ms
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 8
|
||||
max-wait: -1ms
|
||||
max-idle: 8
|
||||
min-idle: 0
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
# rocketmq 配置项
|
||||
rocketmq:
|
||||
name-server: ${ROCKETMQ_NAMESRV_ADDR:127.0.0.1:9876}
|
||||
|
||||
spring:
|
||||
# RabbitMQ 配置项(可选)
|
||||
rabbitmq:
|
||||
host: ${RABBITMQ_HOST:127.0.0.1}
|
||||
port: ${RABBITMQ_PORT:5672}
|
||||
username: ${RABBITMQ_USERNAME:guest}
|
||||
password: ${RABBITMQ_PASSWORD:guest}
|
||||
# Kafka 配置项(可选)
|
||||
kafka:
|
||||
bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVERS:127.0.0.1:9092}
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: ${XXL_JOB_ADMIN_ADDRESSES:http://172.17.16.14:19090/xxl-job-admin}
|
||||
|
||||
--- #################### 服务保障相关配置 ####################
|
||||
|
||||
# Lock4j 配置项
|
||||
lock4j:
|
||||
acquire-timeout: 3000
|
||||
expire: 30000
|
||||
|
||||
--- #################### 监控相关配置 ####################
|
||||
|
||||
# Actuator 监控端点的配置项
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
base-path: /actuator
|
||||
exposure:
|
||||
include: '*'
|
||||
|
||||
# Spring Boot Admin 配置项
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
instance:
|
||||
service-host-type: IP
|
||||
username: ${SPRING_BOOT_ADMIN_USERNAME:admin}
|
||||
password: ${SPRING_BOOT_ADMIN_PASSWORD:admin}
|
||||
|
||||
# 日志文件配置
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
com.viewsh: ${LOG_LEVEL:INFO}
|
||||
file:
|
||||
name: ${LOG_FILE_PATH:/app/logs}/${spring.application.name}.log
|
||||
|
||||
--- #################### 微信公众号、小程序相关配置 ####################
|
||||
wx:
|
||||
mp: # 公众号配置(必填)
|
||||
app-id: ${WX_MP_APP_ID:wx5b23ba7a5589ecbb} # 优先环境变量,兜底默认值
|
||||
secret: ${WX_MP_SECRET:2a7b3b20c537e52e74afd395eb85f61f}
|
||||
config-storage:
|
||||
type: RedisTemplate
|
||||
key-prefix: wx
|
||||
http-client-type: HttpClient
|
||||
miniapp: # 小程序配置(必填)
|
||||
appid: ${WX_MINIAPP_APPID:wxc4598c446f8a9cb3}
|
||||
secret: ${WX_MINIAPP_SECRET:4a1a04e07f6a4a0751b39c3064a92c8b}
|
||||
config-storage:
|
||||
type: RedisTemplate
|
||||
key-prefix: wa
|
||||
http-client-type: HttpClient
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
viewsh:
|
||||
demo: false # 生产环境关闭演示模式
|
||||
env:
|
||||
tag: ${HOSTNAME:prod}
|
||||
captcha:
|
||||
enable: true # 生产环境开启验证码
|
||||
security:
|
||||
mock-enable: false # 生产环境关闭 mock
|
||||
access-log:
|
||||
enable: true
|
||||
wxa-code:
|
||||
env-version: release
|
||||
wxa-subscribe-message:
|
||||
miniprogram-state: formal
|
||||
|
||||
justauth:
|
||||
enabled: true
|
||||
type:
|
||||
DINGTALK: # 钉钉
|
||||
client-id: dingvrnreaje3yqvzhxg
|
||||
client-secret: i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI
|
||||
ignore-check-redirect-uri: true
|
||||
WECHAT_ENTERPRISE: # 企业微信
|
||||
client-id: wwd411c69a39ad2e54
|
||||
client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw
|
||||
agent-id: 1000004
|
||||
ignore-check-redirect-uri: true
|
||||
# noinspection SpringBootApplicationYaml
|
||||
WECHAT_MINI_PROGRAM: # 微信小程序
|
||||
client-id: ${wx.miniapp.appid}
|
||||
client-secret: ${wx.miniapp.secret}
|
||||
ignore-check-redirect-uri: true
|
||||
ignore-check-state: true # 微信小程序,不会使用到 state,所以不进行校验
|
||||
WECHAT_MP: # 微信公众号
|
||||
client-id: ${wx.mp.app-id}
|
||||
client-secret: ${wx.mp.secret}
|
||||
ignore-check-redirect-uri: true
|
||||
ALIPAY: # 支付宝小程序
|
||||
client-id: xx
|
||||
client-secret: xx
|
||||
alipay-public-key: xx
|
||||
ignore-check-redirect-uri: true
|
||||
ignore-check-state: true
|
||||
cache:
|
||||
type: REDIS
|
||||
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
|
||||
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
|
||||
--- #################### 注册中心 + 配置中心相关配置 ####################
|
||||
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: ${NACOS_ADDR:127.0.0.1:8848}
|
||||
username: ${NACOS_USERNAME:nacos}
|
||||
password: ${NACOS_PASSWORD:nacos}
|
||||
discovery:
|
||||
namespace: ${NACOS_DISCOVERY_NAMESPACE:prod}
|
||||
group: DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0
|
||||
config:
|
||||
namespace: ${NACOS_CONFIG_NAMESPACE:prod}
|
||||
group: DEFAULT_GROUP
|
||||
file-extension: yaml
|
||||
refresh-enabled: true
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
spring:
|
||||
datasource:
|
||||
druid: # Druid 【监控】相关的全局配置
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
allow: # 设置白名单,不填则允许所有访问
|
||||
url-pattern: /druid/*
|
||||
login-username: ${DRUID_USERNAME:admin}
|
||||
login-password: ${DRUID_PASSWORD:admin}
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
log-slow-sql: true # 慢 SQL 记录
|
||||
slow-sql-millis: 100
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
dynamic: # 多数据源配置
|
||||
druid: # Druid 【连接池】相关的全局配置
|
||||
initial-size: 5
|
||||
min-idle: 10
|
||||
max-active: 20
|
||||
max-wait: 60000
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 600000
|
||||
max-evictable-idle-time-millis: 1800000
|
||||
validation-query: SELECT 1 FROM DUAL
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
pool-prepared-statements: true
|
||||
max-pool-prepared-statement-per-connection-size: 20
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://172.17.16.8:3306/aiot-platform-test?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: root
|
||||
slave: # 从库配置(可选)
|
||||
lazy: true
|
||||
url: jdbc:mysql://172.17.16.8:3306/aiot-platform-test?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: root
|
||||
|
||||
# Redis 配置
|
||||
data:
|
||||
redis:
|
||||
host: 172.17.16.13
|
||||
port: 6379
|
||||
database: 0
|
||||
password: ""
|
||||
timeout: 5000ms
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 8
|
||||
max-wait: -1ms
|
||||
max-idle: 8
|
||||
min-idle: 0
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
# rocketmq 配置项
|
||||
rocketmq:
|
||||
name-server: ${ROCKETMQ_NAMESRV_ADDR:rmq-4wd73bxpv.rocketmq.sh.qcloud.tencenttdmq.com:8080}
|
||||
|
||||
spring:
|
||||
# RabbitMQ 配置项(可选)
|
||||
rabbitmq:
|
||||
host: ${RABBITMQ_HOST:127.0.0.1}
|
||||
port: ${RABBITMQ_PORT:5672}
|
||||
username: ${RABBITMQ_USERNAME:guest}
|
||||
password: ${RABBITMQ_PASSWORD:guest}
|
||||
# Kafka 配置项(可选)
|
||||
kafka:
|
||||
bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVERS:127.0.0.1:9092}
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: ${XXL_JOB_ADMIN_ADDRESSES:http://172.17.16.14:19090/xxl-job-admin}
|
||||
|
||||
--- #################### 服务保障相关配置 ####################
|
||||
|
||||
# Lock4j 配置项
|
||||
lock4j:
|
||||
acquire-timeout: 3000
|
||||
expire: 30000
|
||||
|
||||
--- #################### 监控相关配置 ####################
|
||||
|
||||
# Actuator 监控端点的配置项
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
base-path: /actuator
|
||||
exposure:
|
||||
include: '*'
|
||||
|
||||
# Spring Boot Admin 配置项
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
instance:
|
||||
service-host-type: IP
|
||||
username: ${SPRING_BOOT_ADMIN_USERNAME:admin}
|
||||
password: ${SPRING_BOOT_ADMIN_PASSWORD:admin}
|
||||
|
||||
# 日志文件配置
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
com.viewsh: ${LOG_LEVEL:INFO}
|
||||
file:
|
||||
name: ${LOG_FILE_PATH:/app/logs}/${spring.application.name}.log
|
||||
|
||||
--- #################### 微信公众号、小程序相关配置 ####################
|
||||
wx:
|
||||
mp: # 公众号配置(必填)
|
||||
app-id: ${WX_MP_APP_ID:wx5b23ba7a5589ecbb} # 优先环境变量,兜底默认值
|
||||
secret: ${WX_MP_SECRET:2a7b3b20c537e52e74afd395eb85f61f}
|
||||
config-storage:
|
||||
type: RedisTemplate
|
||||
key-prefix: wx
|
||||
http-client-type: HttpClient
|
||||
miniapp: # 小程序配置(必填)
|
||||
appid: ${WX_MINIAPP_APPID:wxc4598c446f8a9cb3}
|
||||
secret: ${WX_MINIAPP_SECRET:4a1a04e07f6a4a0751b39c3064a92c8b}
|
||||
config-storage:
|
||||
type: RedisTemplate
|
||||
key-prefix: wa
|
||||
http-client-type: HttpClient
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
viewsh:
|
||||
demo: false # 生产环境关闭演示模式
|
||||
env:
|
||||
tag: ${HOSTNAME:prod}
|
||||
captcha:
|
||||
enable: true # 生产环境开启验证码
|
||||
security:
|
||||
mock-enable: false # 生产环境关闭 mock
|
||||
access-log:
|
||||
enable: true
|
||||
wxa-code:
|
||||
env-version: release
|
||||
wxa-subscribe-message:
|
||||
miniprogram-state: formal
|
||||
|
||||
justauth:
|
||||
enabled: true
|
||||
type:
|
||||
DINGTALK: # 钉钉
|
||||
client-id: dingvrnreaje3yqvzhxg
|
||||
client-secret: i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI
|
||||
ignore-check-redirect-uri: true
|
||||
WECHAT_ENTERPRISE: # 企业微信
|
||||
client-id: wwd411c69a39ad2e54
|
||||
client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw
|
||||
agent-id: 1000004
|
||||
ignore-check-redirect-uri: true
|
||||
# noinspection SpringBootApplicationYaml
|
||||
WECHAT_MINI_PROGRAM: # 微信小程序
|
||||
client-id: ${wx.miniapp.appid}
|
||||
client-secret: ${wx.miniapp.secret}
|
||||
ignore-check-redirect-uri: true
|
||||
ignore-check-state: true # 微信小程序,不会使用到 state,所以不进行校验
|
||||
WECHAT_MP: # 微信公众号
|
||||
client-id: ${wx.mp.app-id}
|
||||
client-secret: ${wx.mp.secret}
|
||||
ignore-check-redirect-uri: true
|
||||
ALIPAY: # 支付宝小程序
|
||||
client-id: xx
|
||||
client-secret: xx
|
||||
alipay-public-key: xx
|
||||
ignore-check-redirect-uri: true
|
||||
ignore-check-state: true
|
||||
cache:
|
||||
type: REDIS
|
||||
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
|
||||
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
|
||||
|
||||
Reference in New Issue
Block a user