You can clean workspace using Workspace cleanup plugin in Jenkins after builds executions.
Install workspace clean up Plug-in
Free Style Job Workspace - cleanup
Go to your existing freestyle job, click on Post-Build actions --> Select Delete workspace when build is done option.
Now run the job. You should be able to see workspace is cleaned up after build is done inside Jenkins node. You will not see any folder with job name, in Ubuntu usually under /var/lib/jenkins/workspace/
Pipeline Job Workspace - cleanup code
Go to your existing pipeline job, you can code something like this below:
pipeline {
agent any
tools {
maven 'Maven3'
}
stages {
stage ("checkout") {
steps {
checkout logic here
}
}
stage ('build') {
steps {
sh "mvn clean install -f MyWebApp/pom.xml"
}
}
}
/*** workspace clean up*/
post {
always {
cleanWs()
}
}
}
Watch this on YouTube video:
Install workspace clean up Plug-in
Free Style Job Workspace - cleanup
Go to your existing freestyle job, click on Post-Build actions --> Select Delete workspace when build is done option.
Now run the job. You should be able to see workspace is cleaned up after build is done inside Jenkins node. You will not see any folder with job name, in Ubuntu usually under /var/lib/jenkins/workspace/
Pipeline Job Workspace - cleanup code
Go to your existing pipeline job, you can code something like this below:
pipeline {
agent any
tools {
maven 'Maven3'
}
stages {
stage ("checkout") {
steps {
checkout logic here
}
}
stage ('build') {
steps {
sh "mvn clean install -f MyWebApp/pom.xml"
}
}
}
/*** workspace clean up*/
post {
always {
cleanWs()
}
}
}
Watch this on YouTube video:


4DDD8453A9
ReplyDeleteWhatsapp Görüntülü Show
Sanal Seks
Skype Show Sitesi
BF61E0EE6C
ReplyDeleteTakipçi Satın Al
En İyi Takipçi Satın Alma Sitesi
Instagram Takipçi Kasma
F4F28F0A1F
ReplyDeleteTakipçi Satın Al
Abone Satın Al
Offshore Hosting