本文介绍了Jenkins 管道清除工作区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在运行 Jenkins 2.x 并且喜欢新的 Pipeline 插件.但是,由于存储库中有如此多的分支,磁盘空间很快就会填满.

We are running Jenkins 2.x and love the new Pipeline plugin. However, with so many branches in a repository, disk space fills up quickly.

是否有任何与 Pipeline 兼容的插件可以在成功构建时清除工作区?

Is there any plugin that's compatible with Pipeline that I can wipe out the workspace on a successful build?

推荐答案

您可以使用 deleteDir() 作为管道 Jenkinsfile 的最后一步(假设您没有更改工作目录).

You can use deleteDir() as the last step of the pipeline Jenkinsfile (assuming you didn't change the working directory).

这篇关于Jenkins 管道清除工作区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 10:31
查看更多