Commit Graph

32 Commits

Author SHA1 Message Date
lzh
db91e9503e refactor(ci): release 走独立 compose 文件,prod 文件回滚成历史原版
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
之前的参数化(docker-compose.core.yml 用 \${VAR:-default} + .env 注入)让运维要在
两台部署机分别维护 .env,体验跟 prod 现状不一致。改回与 prod 同款:每个环境一个
独立的 compose 文件,配置直接硬编码在 yml 里。

改动:
- 新增 docker-compose.release.yml(release 专用:MySQL aiot-platform-release 库、
  Nacos namespace e635b215-...、TDengine database aiot_platform_release、
  XXL-Job executor IP=.7、appname 加 -release 后缀、RocketMQ 内网 .7:9876)
- docker-compose.core.yml 完全恢复到 master 版本(prod 文件未做任何改动)
- 删除 env/ 目录(prod.env.example / release.env.example / .gitignore 都不需要了)
- Jenkinsfile:
  - Initialize 阶段按分支选 COMPOSE_FILE:master→core.yml、release/next→release.yml
  - 所有 docker compose 命令统一用 -f \${env.COMPOSE_FILE}
  - Pre-deploy 移除 .env 文件存在性检查
  - 删除 checkRemoteEnvFileOrFail helper(不再使用)

application.yaml 里的 \${XXL_JOB_EXECUTOR_APPNAME_SUFFIX:} 与 application-prod.yaml
里的 \${TDENGINE_DATABASE:aiot_platform} 保留——默认值与历史一致,prod 行为零变化,
但给 release.yml 注入这两个变量留了入口。
2026-04-28 17:00:24 +08:00
lzh
7c45f56804 chore(ci): 统一预发环境命名 staging → release
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
- env/staging.env.example → env/release.env.example(git mv 保留历史)
- Jenkinsfile:STAGING_DEPLOY_HOST/PATH → RELEASE_*,日志和注释同步
- docker-compose.core.yml、5 个 application.yaml 注释里的 staging → release
- TDengine database:aiot_platform_staging → aiot_platform_release
- XXL-Job appname 后缀:-staging → -release

仅命名调整,不动任何运行行为。
2026-04-28 16:45:11 +08:00
lzh
602217274c build(ci): docker-compose 多环境参数化 + staging 中间件配置隔离
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
问题:docker-compose.core.yml 把 MySQL/Redis/Nacos/RocketMQ/TDengine 等连接信息
全写死成 prod 值,无论 master→PROD 还是 release/next→STAGING 都用同一份,
staging 容器会直接连 prod 数据库写脏数据。

改动:
- docker-compose.core.yml 全参数化(${VAR:-prod_default}),用 YAML anchor
  抽公共 env,未注入 .env 时行为与历史一致(不破坏 prod 当前部署)
- 新增 env/prod.env.example、env/staging.env.example 模板(占位密码进 git)
  和 env/.gitignore(真实 .env 不进 git,由部署机手工维护)
- Jenkinsfile:所有 docker compose 命令加 --env-file .env,并在 Pre-deploy
  Check 阶段验证部署机 .env 文件存在性,缺失直接 fail(防止连错中间件)
- 5 个核心服务 application.yaml 的 xxl-job appname 加 SUFFIX 变量:
    appname: ${spring.application.name}${XXL_JOB_EXECUTOR_APPNAME_SUFFIX:}
  staging 设为 -staging,prod 留空。否则 staging 与 prod 注册到同一个执行器
  组,admin 调度任务会随机打到任一边
- iot-server application-prod.yaml TDengine database 参数化:
    /aiot_platform → /${TDENGINE_DATABASE:aiot_platform}
  staging 用独立 database aiot_platform_staging,避免共享 prod 时序数据

staging 中间件方案:
- MySQL 同实例(172.17.16.8)独立库 aiot-platform-release
- Nacos 同实例独立 namespace e635b215-913e-4bc8-8867-2fbf7d5134aa
- Redis 同 prod 实例(短期,靠 application 层 key 前缀隔离)
- RocketMQ 改用 staging 服务器本地实例 172.17.16.7:9876(内网)
- TDengine 同 prod 实例独立 database(CTSDB 切换为 follow-up)
- XXL-Job admin 共用,executor IP=.7、appname 加 -staging 后缀
2026-04-28 16:37:27 +08:00
lzh
a68ce9a28a fix(xxl-job): 配置executor IP和端口解决跨服务器回调失败
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
XXL-Job Admin部署在Infra服务器,executor运行在Prod服务器的Docker容器中,
容器内部IP不可达,需指定宿主机IP和独立端口供Admin回调。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 17:03:39 +08:00
lzh
748b09d355 fix(rocketmq): 添加腾讯云TDMQ ACL认证配置解决连接失败
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
修复RocketMQ发送消息报"No accessKey is configured"错误,
统一各模块环境变量名为ROCKETMQ_NAMESRV_ADDR。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:50:44 +08:00
lzh
91de356a67 fix(iot-gateway): 修正RPC环境变量名为VIEWSH_IOT_GATEWAY_RPC_URL
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
Spring Boot relaxed binding将viewsh.iot.gateway.rpc.url映射为
VIEWSH_IOT_GATEWAY_RPC_URL,而非VIEWSH_GATEWAY_RPC_URL。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:17:06 +08:00
lzh
e15ebfd3d4 fix(iot-gateway): 修正RPC环境变量名不匹配导致连接失败
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
docker-compose中VIEWSH_IOT_GATEWAY_RPC_URL与yaml期望的VIEWSH_GATEWAY_RPC_URL不一致,
导致iot-gateway回退到默认值127.0.0.1:48091,容器间无法通信。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:39:37 +08:00
lzh
26e909cce9 fix(deploy): 迁移Nacos/TDengine/XXL-Job至Infra服务器(172.17.16.7)
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
将基础设施服务地址从Prod服务器(172.17.16.14)统一迁移至Infra服务器(172.17.16.7):
- Nacos: 172.17.16.14:8848 → 172.17.16.7:8848
- TDengine: 172.17.16.14:6041 → 172.17.16.7:6041
- XXL-Job: 172.17.16.14:19090 → 172.17.16.7:19090

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:22:02 +08:00
lzh
547da7cfd2 refactor(deploy): 迁移CI/CD至双服务器架构
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
- 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>
2026-02-13 10:41:54 +08:00
lzh
cea43d282c fix: 修复iot-gateway调用iot-server地址错误问题 2026-01-16 15:31:29 +08:00
lzh
8a543db18f fix: 修复iot-gateway容器端口未映射
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-16 11:46:47 +08:00
lzh
cfdf065f37 fix: 修复XXL_JOB地址
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-15 16:59:11 +08:00
lzh
c8010e06d2 feat(ops): add deployment configuration and actuator dependency
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-15 16:30:15 +08:00
lzh
520aa027fa fix: iot-server容器端口改为48091
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-14 21:49:35 +08:00
lzh
bcbbde1879 fix: iot-gateway去除健康检查、nacos配置
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-14 17:48:00 +08:00
lzh
b0300ef5d9 fix: 修复端口写错bug
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-14 16:32:00 +08:00
lzh
99a4d72e04 fix: 调整IOT服务端口适配健康检查
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-14 16:14:35 +08:00
lzh
2a4400e8ee fix: Jenkins修复8-改为使用1panel-network容器网络
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-14 13:50:20 +08:00
lzh
cfc4238c99 fix: Jenkins修复6-移除tdengine服务依赖
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-14 13:00:35 +08:00
lzh
4162783263 fix: Jenkins修复3-iot-server时序库缺失
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-14 12:02:30 +08:00
lzh
52017f7e23 fix: Jenkins修复3-prod缺失配置添加
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-14 11:43:47 +08:00
lzh
4a71719e51 fix: Jenkins修复3-修改数据库名称
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-14 11:22:46 +08:00
lzh
a20ef566d0 fix: Jenkins修复3-修改nacos配置
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-14 11:12:28 +08:00
lzh
282457d53d fix: Jenkinsfile修复2
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-14 10:42:13 +08:00
lzh
efe05ad624 refactor: 重构配置管理,移除.env依赖,使用docker-compose环境变量+Nacos配置中心
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
- 更新所有application-prod.yaml,将环境变量占位符替换为硬编码默认值
- 重写docker-compose.core.yml,使用Spring Boot环境变量命名规范
- 修复Jenkins pipeline中的getContainerName方法调用错误
- 配置优先级:Nacos配置中心 > Docker环境变量 > application-prod.yaml

变更文件:
- viewsh-gateway/src/main/resources/application-prod.yaml
- viewsh-module-system-server/src/main/resources/application-prod.yaml
- viewsh-module-infra-server/src/main/resources/application-prod.yaml
- viewsh-module-iot-server/src/main/resources/application-prod.yaml
- viewsh-module-iot-gateway/src/main/resources/application-prod.yaml
- docker-compose.core.yml
- Jenkinsfile
2026-01-13 23:50:37 +08:00
lzh
1f03c44a39 fix: 修复一直重启、构建bug
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-13 22:04:33 +08:00
lzh
b7664f7dd0 fix: 修复健康检查和配置问题
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
- 修复健康检查 IP 地址 (172.17.16.14 -> localhost)
  - 禁用微信自动配置避免 appid 错误
  - 添加服务依赖关系和启动顺序
  - 优化 Jenkinsfile 部署流程
  - 添加 Quartz 优雅关闭配置
  - 注释 XXL-JOB Admin 配置(暂不部署)
2026-01-13 19:13:30 +08:00
lzh
93e8848845 fix: 使用宿主机 IP 进行健康检查
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
改用 172.17.16.14 替代 localhost

确保健康检查在 host 网络模式下正常工作
2026-01-13 18:15:31 +08:00
lzh
b3d13dacc8 fix: 使用宿主机 IP 进行健康检查
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
- 改用 172.17.16.14 替代 localhost
- 确保健康检查在 host 网络模式下正常工作
2026-01-13 18:12:44 +08:00
lzh
676e7d6c31 fix: 添加 REDIS_DATABASE 环境变量到所有服务
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
- 所有服务添加 REDIS_DATABASE 环境变量
- 默认值为 0
- 解决 Redis 配置无法正确解析的问题
2026-01-13 17:27:59 +08:00
lzh
62978560c5 feat: iot-gateway 支持 Nacos 配置管理
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
- 在 application.yaml 中添加 Nacos config import
- 在 application-prod.yaml 中添加 Nacos 配置
- 在 docker-compose.core.yml 中注入 Nacos 环境变量
- 支持配置统一管理和动态刷新
- 与其他微服务保持架构一致性
2026-01-13 14:10:05 +08:00
lzh
b3948df69b feat: 添加 Jenkins CI/CD 配置和部署脚本
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
- 添加 Jenkinsfile 支持智能增量构建
- 添加 Docker 多阶段构建模板
- 添加 Docker Compose 配置(连接 1Panel 中间件)
- 添加部署、回滚、清理脚本
- 添加环境变量配置模板
2026-01-13 09:49:19 +08:00