首先需要安装Workspace Cleanup插件(默认新版本应该是安装好的)
参考官网https://github.com/jenkinsci/ws-cleanup-plugin

stages{
    stage('清除空间') {
        steps {
            // Clean before build
            cleanWs()
        }
    }
}

我设置的如下

2022-07-19T03:20:31.png

打包效果如下
2022-07-19T03:21:06.png

Last modification:September 2, 2022
如果觉得我的文章对你有用,请随意赞赏