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
• 18,070 points
4,917 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
• 51,890 points

Related Questions In Jenkins

0 votes
2 answers
+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,420 points
598 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
• 51,890 points
3,275 views