TeamCity On-Premises
 
2020.2
You are viewing the documentation for an earlier version of TeamCity On-Premises.

Build Files Cleaner (Swabra)

Last modified: 16 February 2021

Swabra is a bundled plugin allowing you to clean files created during the build.

The plugin remembers the state of the file tree after the sources checkout and deletes all the newly added files at the end of the build or at the next build start depending on the settings. Swabra also detects files modified or deleted during the build and reports them to the build log (however, such files are not restored by the plugin). The plugin can also ensure that by the start of the build there are no files modified or deleted by previous builds and initiate clean checkout if such files are detected.

Moreover, Swabra gives the ability to dump processes which lock directory by the end of the build (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 the checkout directory for newly created, modified and deleted files and enable file locking processes detection.

The checkout directory state is saved into a file in the caches directory named <checkout-directory-name-hash>.snapshot using the DiskDir format. The path to the checkout directory to be cleaned is saved into the snapshot.map file. The snapshot is used later (at the end of the build or at the next build start) to determine which files and folders are newly created, modified or deleted. It is done based on the actual files' presence, last modification data and size comparison with the corresponding records in the snapshot.