I think this will work on windows: del /F . On Linux: rm -rf *
But you should be very careful, especially if agent is installed on the same PC where server is running. Under some circumstances such commands can wipe all your data.
It will wipe everything under the working directory. But if someone will change the working directory to C:\Windows or smthg like that... It is much safer to have such agents running from the VMWare images, because in this case you can easily recreate agent environment.
If you are using TeamCity 6.0, probably "Swabra build feature" will be of some help: http://confluence.jetbrains.net/display/TCD6/Adding+Swabra+as+a+Build+Feature
Swabra also available as a separate plugin: http://confluence.jetbrains.net/display/TW/Swabra
Thanks Pavel
Yes, we are using v6.
But as far as I can see, the new Swabra feature only deletes files that were produced by the build process.
Whereas I would like to delete *all* files.. e.g. the onces checked out of source control as well.
What about adding a build step which will clean all of the files in checkout directory?
Sounds like an interesting idea.
What command exactly would do that?
I think this will work on windows:
del /F .
On Linux:
rm -rf *
But you should be very careful, especially if agent is installed on the same PC where server is running. Under some circumstances such commands can wipe all your data.
OK, if I create a build step with this configuration:
Runner type: Command Line
Working directory: E:\TeamCity\MyApplication\Release
Run: Executable with Parameters
Command executable: del
Command parameters: /F /Q .
Will it wipe all my data or just the build data and source code?
It will wipe everything under the working directory. But if someone will change the working directory to C:\Windows or smthg like that...
It is much safer to have such agents running from the VMWare images, because in this case you can easily recreate agent environment.
Thanks Pavel