Jenkins Pipeline Wipe Out Workspace

前端 未结 13 1442
你的背包
你的背包 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:36

    Using the following pipeline script:

    pipeline {
        agent { label "master" }
        options { skipDefaultCheckout() }
        stages {
            stage('CleanWorkspace') {
                steps {
                    cleanWs()
                }
            }
        }
    }
    

    Follow these steps:

    1. Navigate to the latest build of the pipeline job you would like to clean the workspace of.
    2. Click the Replay link in the LHS menu.
    3. Paste the above script in the text box and click Run

提交回复
热议问题