> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.stacktrack.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Clean Jenkins Workspace

Cleaning a workspace is an important housekeeping activity for your pipelines because we rarely overprovision storage so there is usually only enough space on an agent for a few builds. If the intention is that you want to resuse agents then we advise you to perform some housekeeping activities in your pipelines. To do this we leverage the post function in the Jenkins pipeline to execute tasks at the end of a pipeline. The post pipeline supports properties to enable you to run various activities based on the success of the pipeline.

### Clean Workspace
```
post {
 always {
   deleteDir()
 }
}
```