Jenkins Pipeline Wipe Out Workspace

前端 未结 13 1431
你的背包
你的背包 2020-12-04 08:59

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.

Is there any plugin that

13条回答
  •  执笔经年
    2020-12-04 09:53

    Like @gotgenes pointed out with Jenkins Version. 2.74, the below works, not sure since when, maybe if some one can edit and add the version above

    cleanWs()
    

    With, Jenkins Version 2.16 and the Workspace Cleanup Plugin, that I have, I use

    step([$class: 'WsCleanup'])
    

    to delete the workspace.

    You can view it by going to

    JENKINS_URL/job//pipeline-syntax
    

    Then selecting "step: General Build Step" from Sample step and then selecting "Delete workspace when build is done" from Build step

提交回复
热议问题