From d9d7a1d1155a048e1d63b45df8f8a078cff3b250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E8=89=B3?= Date: Fri, 7 Aug 2026 10:00:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96Jenkins=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E7=BA=BF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改agent配置为any,提高流水线灵活性 - 添加构建历史清理策略,保留最近3次或30天内的构建记录 - 优化磁盘空间使用,避免构建记录无限增长 Co-Authored-By: Claude Sonnet 4.6 --- Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0b1b40c74..9c0fde7f2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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: '请选择发布的项目') }