Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete Hudson workspace before build?

Tags:

java

build

hudson

I want to have a way to teach hudson to delete the complete workspace before doing a checkout & build. Is there a plugin which enables that?

like image 825
Mauli Avatar asked May 19 '09 13:05

Mauli


People also ask

What is delete workspace before build starts?

The plugin provides a build wrapper (Delete workspace before build starts) and a post build step (Delete workspace when build is done). These steps allow you to configure which files will be deleted and in what circumstances. The post build step can also take the build status into account.

How do I clean my workspace before building Jenkins pipeline?

There is a way to clean up a workspace in Jenkins. You need to install the Workspace Cleanup Plugin. This plugin can clean up the workspace before build or after a build. Under Build Environment, check the box that says Delete workspace before build starts.

How do I delete a workspace in Jenkins?

To clean up the workspace before build: Under Build Environment, check the box that says Delete workspace before build starts. To clean up the workspace after the build: Under the heading Post-build Actions select Delete workspace when build is done from the Add Post-build Actions drop down menu. Save this answer.

Is it safe to delete Jenkins workspace?

Delete TFS Workspaces in Jenkins Job Then it is safe to call the post-build command “Delete workspace” which is deleting the files physically. However, you will notice that by default you cannot insert post build Windows batch commands. To be able to do so, you need to install a new plugin- Post-Build Script Plug-in.


2 Answers

Currently, each SCM plugin provides workspace cleanup functionality. Soon, core Hudson will have this capability, and the SCM plugins will migrate the setting to that core feature: issue 3966

like image 177
Michael Donohue Avatar answered Nov 08 '22 00:11

Michael Donohue


Under Source Code Management, expand the advanced properties and un-check "Use Update" (this option is present for me for CVS, not sure about all other SCM tools). This option controls if Hudson uses an "update" command to simply grab changed files from SCM, or if it checks out a new/clean copy from source control.

like image 24
matt b Avatar answered Nov 07 '22 23:11

matt b