ci: ACR镜像清理策略 + CI自动清理 #593
Reference in New Issue
Block a user
Delete Branch "ci/acr-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
变更内容
1. 清理脚本
scripts/ci/acr_cleanup.pyACR镜像生命周期管理工具,纯Python标准库实现,无额外依赖。
清理策略:
v*):永久保留latest,main,develop,master,dev,stable):永久保留api-cache,worker-cache,web-cache):全部跳过pr-*):保留7天,过期自动删除特性:
--dry-run预览模式--keep N自定义保留数量--pr-days N自定义PR保留天数--repo NAME指定单个仓库2. CI清理job
ci-build.yml新增
acr-cleanupjob,在build-staging完成后自动执行:main/develop分支验证结果 ✅
删除成功率:100%(262/262)
最早保留时间:API 7/16、Worker 7/15、Web 7/17(均覆盖最近3-4天构建)
执行时长:约5分钟
dry-run预览验证通过
全量实际清理执行完成
清理后tag数验证正确
CI全绿,自动审批通过。
CI全绿,自动审批通过。
🗑️ 预览环境已清理
PR #593 已关闭或合并,对应的预览环境已被清理。