Jenkins Pipeline Wipe Out Workspace

0 votes
I started using the pipeline plugin and its amamzing. But the problem is, its taking too much space. Is there any plugin that's compatible with Pipeline that I can wipe out the workspace on a successful build?
Aug 6, 2018 in Jenkins by Hannah
• 15,620 points
1,421 views

1 answer to this question.

0 votes

You should probably put it in a post-built-step conditionlike always:

pipeline {
    agent any
    stages {
        stage('Example') {
            steps {
                echo 'Hello World'
            }
        }
    }
    post {
        always {
            cleanWs()
        }
    }
}
answered Aug 6, 2018 by Kalgi
• 41,760 points

Related Questions In Jenkins

0 votes
2 answers
0 votes
2 answers

How to trigger a Jenkins pipeline A in another Jenkins pipeline B?

If you are talking about executing another ...READ MORE

answered Jul 31 in Jenkins by Sirajul
• 30,940 points
5,440 views
0 votes
1 answer

How to rebuild an item on Jenkins pipeline

Yes you can, its pretty simple actually. Go ...READ MORE

answered Jul 10, 2018 in Jenkins by Kalgi
• 2,620 points
267 views
0 votes
1 answer

Jenkins: Build Pipeline Plugin Scheduled Trigger

This can be done by setting the ...READ MORE

answered Jul 10, 2018 in Jenkins by Sophie may
• 9,850 points
479 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
181 views
0 votes
1 answer
+1 vote
3 answers
0 votes
1 answer

Empty Jenkins Workspace causing Jenkins build failure

/tmp/hudson3579240812233061648.sh: line 3: cd: /jenkins/workspace/completeness_compiler_runtime_tests/TPS/qel/automation/tools The error is ...READ MORE

answered Aug 8, 2018 in Jenkins by Kalgi
• 41,760 points
1,301 views