The plugin is bundled since TeamCity 5.1. The recent version is described in the documentation for the latest TeamCity release.
Plugin adds support for cleaning new files created during the build. The files modified during the build are also reported in the build log (but are not affected by the plugin).
The plugin remembers the state of the file tree after the sources checkout and then deletes all the newly added files on the build finish or on next build start (depending on the options)To learn more about the plugin, please read the recent plugin page in the documentation for the latest TeamCity release.
Plugin Development Status
In final stage of development. Snapshot builds are available.
Everyone is encouraged to try the plugin.
TeamCity Versions Compatibility
The current plugin version is designed to work Plugin was bundled with TeamCity 5.x and TeamCity 4.5.x (there are two plugin configurations).
In TeamCity 6.0 Swabra became a build feature.
To learn more on using old Swabra versions, please read previous versions of this document.
<TeamCity Data Directory>/pluginsfolder.
- Restart the server.
The plugin can be used with any runner. Swabra tab provides UI options to enable scanning checkout directory for newly created and modified files.
Cleaning can be performed before or after the build.
First the plugin is turned on, it initiates clean checkout, after which in the checkout directory there are only essential files and no "garbage". At this moment the state of the checkout directory 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 int snapshot.map file.
This snapshot is used later (after the build finish or at the start of the next build) to determine which files and folders are newly created or modified. It is done by actual files' presence, last modification data and size comparison with corresponding records in the snapshot.
Сonfiguring plugin via UI options
The plugin adds its configuration settings panel to the runner settings page: choose Swabra mode as before or after build.
If you choose
After build mode build files cleanup will be performed after the build. Between builds there will be clean copy in the checkout directory which gives possibility to free more disk space.
If you choose
Before next build mode previous build files cleanup will be performed at build start. You only need to use this mode if files are required between builds or for debugging.
Strict mode option to enable Swabra "strict" mode. The build will fail if at the start there are any files which were created during previous build.
When performing files deletion on Windows agents Swabra may come across files and folders which are locked by some outside processes.
If you check the
Determine file locking processes on Windows agents option the plugin will attempt to kill these processes and finally remove files (in
Strict mode) or just report (in normal mode) these processes.
If this option is unchecked list of newly created during the build files, which Swabra failed to delete will appear in the build log.
Locking processes detection can also be turned on when build files cleanup is disabled. In such case useful information about locking processes (or their absence) will appear in the build log.
To enable locking processes detection you also have to download Handle.
Verbose output option to enable detailed logging to build log.
URL for downloading Handle.zip, press
Download button and TeamCity will automatically download Handle, extract and send to Windows agents.
The executable will be stored under
Note that Handle will be present on agents only after the upgrade process.
You may also download Handle, extract it on agent and set up the
handle.exe.path system property manually.
Generally snapshot file is deleted after files collection. Set
swabra.preserve.snapshot system property to preserve snapshots for debug purposes.
h3. Known Issues
Issue in TeamCity tracker.