In addition to build steps you can add a build feature to the build process, which allows to define advanced options. Bundled Swabra plugin allows to clean files created during the build. The files modified or deleted during the build are also reported in the build log (however they are not affected by the plugin). The plugin remembers the state of the file tree after the sources checkout and on next build start deletes all the newly added files.
Swabra can also ensure clean checkout for directory and clean checkout at build start if there are any modified or deleted files in the checkout directory. Moreover, Swabra also gives the ability to dump processes which locked the checkout directory before build finish (requires handle.exe)
Swabra can be added as a build feature to your build configuration regardless of what set of build steps you have. By configuring its options you can enable scanning checkout directory for newly created, modified and deleted files and enable file locking processes detection.
Checkout directory state is saved into a file in the caches directory named
<checkout_directory_name_hash>.snapshot using DiskDir format. Checkout directory to snapshot name map is saved into snapshot.map file. The snapshot is used later (at the start of the next build) to determine which files and folders are newly created, modified or deleted. It is done by actual files' presence, last modification data and size comparison with corresponding records in the snapshot.
Configuring Swabra Options
Select whether you want to perform build files cleanup, and when it should be performed.
Select the Force clean checkout if cannot restore clean directory state option to ensure that the checkout directory corresponds to the sources in the repository at the build start. If Swabra detects any modified or deleted files in the checkout directory before the build start, it will enforce clean checkout. The build will fail if Swabra cannot delete some files created during previous build.
If this option is disabled you will only get warnings about modified and deleted files.
Paths to monitor
Specify newline or comma separated set of
+|-:checkout_dir_relative_path rules to define what files and folders should be involved in files collection process (by default all paths are included).
-: prefix is specified, a rule as treated as "include".
A path can be checkout directory relative path or a mask with ant-style wildcards.
Ignoring a directory leads to ignoring the whole it's content.
Rules on any path should come in order from more abstract to more concrete, e.g. use
* to exclude all
dir folders and their content, or
-:some/dir, +:some/dir/inner to exclude
some/dir folder and all it's content except
inner subfolder and it's content.
Select whether you want Swabra to inspect the checkout directory for processes locking files in this directory, and what to do with such processes. Note that for locking processes detection handle.exe is required on agents. Click the
Insatall SysInternals handle.exe link for downloading or uploading.
Check this option to enable detailed logging to build log.
Default excluded paths
If the build is set up to checkout on agent swabra by default ignores all
CVS folders and their content.
To turn off this behaviour specify empty
swabra.default.rules configuration parameter.
URL for downloading handle.exe or download it manually and specify path on local machine, press
Download button and TeamCity will automatically download or upload handle.exe and send to Windows agents.
handle.exe is present on agents only after the upgrade process.
Note that you need to have enough permissions to start the download.
You may also download handle.exe, extract it on agent and set up the
handle.exe.path system property manually.
Please note that running handle.exe requires some additional permissions for the build agent user. For more details please read this thread.
Generally snapshot file is deleted after files collection. Set
swabra.preserve.snapshot system property to preserve snapshots for debug purposes.
Sources in JetBrains Subversion repository.
Builds for TeamCity 5.x and
Builds for TeamCity 5.0.x and
Builds for TeamCity 4.5.x at JetBrains public TeamCity