Plugin adds support for cleaning new files created during the build. The files modified or deleted 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).
The plugin also gives the ability to dump processes which lock the checkout directory before build finish (requires handle.exe)
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 with TeamCity 5.x, TeamCity 5.0.x and TeamCity 4.5.x (there are three plugin configurations).
<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, modified and deleted files.
Cleaning can be performed before or after the build.
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 (after the build finish or 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.
In any mode Swabra performs newly created files deletion.
Strict mode to ensure that the checkout directory corresponds to the sources in the repository at the build start. If detecting any modified or deleted files in the checkout directory before the build start Swabra will enforce clean checkout.
Strict mode you will only get warnings about modified and deleted files.
Kill locking processes option checked when Swabra comes across a newly created file which is locked it tries to kill the locking process and finally perform the deletion.
С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. At the build start the checkout directory will correspond to the sources in the repository. Note that in case of detecting modified or deleted files Swabra will initiate clean checkout.
If you check the
Kill locking processes option for Windows agents the plugin will attempt to kill locking processes and finally remove files.
Locking processes detection can also be turned on when build files cleanup is disabled. In such case information on locking processes (or their absence) will appear in the build log.
Both killing and detecting locking processes require handle.exe. Click the
Download handle.exe link for downloading.
Verbose output option to enable detailed logging to build log (only for before build mode).
URL for downloading Handle.zip, press
Download button and TeamCity will automatically download Handle, extract and send to Windows agents.
handle.exe will be 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, 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.
Issue in TeamCity tracker.