gpt4 book ai didi

git - Jenkins 删除旧作业历史的未跟踪文件和目录

转载 作者:行者123 更新时间:2023-12-02 09:26:29 24 4
gpt4 key购买 nike

我是 Jenkins 的全新用户。我最近遇到了一个失败的产品构建,其中我看到该特定产品的过去未跟踪的 Maven 模块被添加到当前存在的要构建的 Maven 模块集中。

据我所知,这里发生的实际情况是,以前存在的 git master 分支已更改为另一个正在开发中的新分支。由于使用相同的作业来构建该产品,从旧作业历史记录中索引的过去主分支的模块已与最新的主分支 Maven 模块混合,因此显示两个分支的所有模块。

是否有任何模式(例如插件)使我们能够在使用现有 Jenkins 构建的 Jenkins 构建之前以类似于 git clean 命令的方式清理未跟踪的 Maven 模块(基本上是文件和目录)?

最佳答案

有一个选项源代码管理 → 附加行为 → 添加 → checkout 前清理:

Clean up the workspace before every checkout by deleting all untracked files and directories, including those which are specified in .gitignore. It also resets all tracked files to their versioned state. This ensures that the workspace is in the same state as if you cloned and checked out in a brand-new empty directory, and ensures that your build is not affected by the files generated by the previous build.

关于git - Jenkins 删除旧作业历史的未跟踪文件和目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37568646/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com