优化Jenkins流水线配置

- 修改agent配置为any,提高流水线灵活性
- 添加构建历史清理策略,保留最近3次或30天内的构建记录
- 优化磁盘空间使用,避免构建记录无限增长

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
王文艳
2026-08-07 10:00:23 +08:00
parent 46ec261e7b
commit d9d7a1d115
Vendored
+5 -1
View File
@@ -71,7 +71,11 @@ def PROJECT_CONFIG = [
]
pipeline {
agent { label 'linux' }
agent any
options {
// 自动保留最近 3 次构建记录,或者保留最近 30 天的记录
buildDiscarder(logRotator(numToKeepStr: '3', daysToKeepStr: '30'))
}
parameters {
choice(name: 'PROJECT_NAME', choices: ['chafangtong', 'fangjia', 'fangjiapds', 'fangjiastatic', 'geluke', 'fangjiaopen', 'fangjia-script'], description: '请选择发布的项目')
}