26 Commits

Author SHA1 Message Date
af95c8acac fix: deployPort:15020,15021 2025-06-24 11:13:04 +08:00
a418a680f6 更新 Dockerfile 2025-06-24 10:27:20 +08:00
b68ee6dfa6 更新 Jenkinsfile 2025-06-24 10:22:32 +08:00
4862d39139 fix: Optimize Docker build and resolve network timeout issues
根据Gemini建议的优化方案:

 **Dockerfile修复**:
- 修复FROM语句大小写警告 (as -> AS)
- 修复Maven settings.xml中的XML标签错误 (<n> -> <name>)
- 优化健康检查端点支持Actuator标准
- 统一使用mvnw执行命令

 **Jenkinsfile优化**:
- 简化Docker buildx命令,移除可能导致网络问题的参数
- 添加备用构建方案:Buildx失败时自动切换到传统Docker构建
- 移除复杂的缓存配置,先确保基本构建正常
- 优化错误处理和重试逻辑
- 减少重试次数避免无谓等待

 **工具脚本**:
- setup-docker-mirrors.sh: 配置Docker镜像加速器
- test-docker-build.sh: 测试Docker构建环境
- 包含网络优化和构建器验证

**主要解决问题**:
- Docker Hub网络超时问题
- Buildx配置复杂性
- 构建失败时的降级策略

下一步建议在服务器运行 scripts/setup-docker-mirrors.sh 配置镜像加速器
2025-06-24 10:08:54 +08:00
98b08af4a3 fix: Remove network.host and simplify Buildx configuration
Issues fixed:
-  Remove --network=host (not allowed by daemon config)
-  Remove --mount=type=cache from Dockerfile (compatibility)
-  Simplify builder management and error handling
-  Keep caches on build failure for faster retries
-  Use standard Docker layer caching instead of BuildKit mount

This should resolve the 'granting entitlement network.host is not allowed' error.
2025-06-24 09:08:13 +08:00
269496438a fix: Fix Jenkinsfile syntax errors and optimize for pre-installed Buildx
Fixes:
-  Fix missing indentation on line 127 (catch block)
-  Fix stage indentation issues
-  Remove automatic Buildx installation since it's pre-installed on server

Optimizations:
-  Use existing Docker Buildx v0.25.0 installation
-  Preserve buildx builder instance across builds for better performance
-  Improved builder instance lifecycle management
-  Better error handling and logging

The pipeline should now parse correctly and utilize the manually installed Buildx.
2025-06-24 09:02:35 +08:00
fea1b828ec fix: Fix Jenkinsfile syntax errors
- Fix indentation issues in pipeline stages
- Fix missing stage separation causing compilation error
- Ensure proper stage closure and formatting
- This resolves the 'Expected a stage @ line 131' error
2025-06-24 00:18:05 +08:00
4d7b72d9e5 feat: Add simplified Dockerfile as backup option
- Add Dockerfile.simple with single-stage build
- Uses system Maven instead of Maven Wrapper
- Simpler and more reliable for environments with wrapper issues
- Can be used as fallback if Buildx build fails
2025-06-24 00:13:20 +08:00
1f90427fb7 feat: Enable Docker Buildx for faster and more reliable builds
Features:
-  Enable Docker Buildx with advanced caching
-  Add BuildKit cache mount for Maven dependencies
-  Use Aliyun Maven mirror for faster dependency downloads
-  Optimize Docker layer caching strategy
-  Add automatic cache cleanup to prevent disk overflow
-  Increase build timeout to 30 minutes
-  Add buildx builder instance management

Performance improvements:
- Parallel builds with Buildx
- Persistent Maven cache with RUN --mount=type=cache
- Layer-optimized Dockerfile structure
- Automatic cache rotation

This should significantly reduce Docker build time and improve reliability.
2025-06-24 00:08:36 +08:00
1a8d663c51 fix: Add missing maven-wrapper.jar for Docker builds
- Download maven-wrapper.jar from Maven Central Repository
- Update .gitignore to allow maven-wrapper.jar to be committed
- This fixes 'Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain' error
- Ensures Maven Wrapper works properly in CI/CD and Docker environments
- Enables builds without pre-installed Maven
2025-06-23 23:36:10 +08:00
b285211b6c fix: add execute permission to mvnw script in Docker build 2025-06-23 23:17:37 +08:00
90155a696a add: .dockerignore to reduce build context size 2025-06-23 22:39:48 +08:00
caa85bc6e8 perf: optimize Docker build - use Alpine images, add timeout handling and retry logic 2025-06-23 22:36:43 +08:00
194442170e fix: replace jacocoAdapter with publishHTML for Jenkins compatibility 2025-06-23 21:58:12 +08:00
f2a1a146b7 fix: comprehensive Jenkinsfile syntax fixes - proper stage structure and formatting 2025-06-23 21:54:48 +08:00
aaa3c78706 fix: fix Jenkinsfile syntax errors - remove extra braces 2025-06-23 21:47:45 +08:00
9c995305b4 fix: fix HealthControllerTest JSON path and update JaCoCo plugin usage 2025-06-23 21:38:04 +08:00
22d7087d1f fix: fix Spring Boot test configuration issues 2025-06-23 21:26:08 +08:00
7b8bd55554 feat: 完善Jenkins流水线配置
主要更新:
- 使用SSH私钥认证替代用户名密码认证
- 配置deploy-server-ssh-key凭据ID
- 修复Jenkinsfile格式和缩进问题
- 添加SSH配置指南和企业级部署文档

 技术改进:
- 使用sshagent进行安全的SSH连接
- 移除sshpass依赖,提升安全性
- 统一使用root@116.62.163.84进行部署
- 优化Docker镜像传输和部署流程

 新增文档:
- SSH_CONFIG_GUIDE.md - SSH私钥配置指南
- ENTERPRISE_JENKINS_GUIDE.md - 企业级Jenkins部署
- jenkins-docker/ - Jenkins Docker化部署方案
2025-06-23 21:14:09 +08:00
0725abdcb4 fix: 修复Jenkinsfile语法错误和缩进问题
- 修复stages缩进错误
- 修复stage之间缺少换行的问题
- 修复script块中的格式错误
- 确保所有stage都有正确的缩进
2025-06-23 20:27:15 +08:00
76e1b34f4a fix: 恢复tools配置,使用Jenkins自动安装的Maven
- 恢复tools配置,使用Maven-3.9.6自动安装
- 简化环境检测,信任Jenkins工具管理
- 移除动态Maven命令检测
- 确保使用标准mvn命令
2025-06-23 20:20:30 +08:00
fff588cdec resolve: 解决Jenkinsfile合并冲突,保留修复版本 2025-06-23 20:04:17 +08:00
5db7bc7815 fix: 修复Jenkins流水线JDK安装和上下文问题
- 移除tools自动安装配置,改用环境检测
- 修复所有sh和cleanWs步骤的上下文问题
- 增加异常处理和错误恢复机制
- 支持Maven Wrapper作为fallback
- 添加Jenkins工具配置和问题排查指南
2025-06-23 20:02:56 +08:00
4378b743ce 更新 Jenkinsfile 2025-06-23 19:12:34 +08:00
abdb259a9f 更新Jenkins配置支持SSH用户名密码认证 + 添加详细的Jenkins面板操作指南
- 修改Jenkinsfile支持SSH用户名密码认证方式
- 添加JENKINS_PANEL_GUIDE.md详细操作指南
- 添加QUICK_START.md快速配置清单
- 添加服务器配置脚本支持用户名密码认证
- 更新配置文档和部署说明
2025-06-23 18:39:00 +08:00
877335f73f Initial commit: Jenkins CI/CD Demo Project with Spring Boot 3 2025-06-23 16:50:28 +08:00