Mauli
Mauli

Reputation: 17203

How to delete Hudson workspace before build?

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?

Upvotes: 11

Views: 13686

Answers (6)

Edgar Kenji Tanaka
Edgar Kenji Tanaka

Reputation: 73

There is an option under Advanced Project Options: Clean workspace before build.

It does exactly what you want.

Upvotes: 3

CJBrew
CJBrew

Reputation: 2787

The Subversion plugin for Hudson now has a switch to "Emulate Checkout" -- it removes unversioned files before reverting and updating.

Upvotes: 0

Michael Donohue
Michael Donohue

Reputation: 11876

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

Upvotes: 7

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657861

I haven't used them yet, but AFAIK there are hudson-plugins available which allow batch scripts to run as pre- and post-build steps which could delete the directory. Check out: Manage Hudson -> Manage Plugins -> Available

Upvotes: 1

MikeNereson
MikeNereson

Reputation: 3900

Uncheck Use Update under SCM options AND use call maven's clean phase in your command.

Upvotes: 2

matt b
matt b

Reputation: 140011

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.

Upvotes: 7

Related Questions