Child pages
  • Swabra
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 30 Next »


This section concerns only the latest version of the plugin. You are welcome to download it directly from public TeamCity server.

General Info




Apache 2.0


free, open-source

Plugin Description

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).


Directly from public TeamCity server:
5.x last nightly build
5.0.x last nightly build
4.5.x last nightly build


Installation instructions

  1. Put into <TeamCity Data Directory>/plugins folder.
  2. Restart the server.

Plugin usage

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 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.

Use 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.

Without Strict mode you will only get warnings about modified and deleted files.

With 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.

Check 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.

Check Verbose output option to enable detailed logging to build log (only for before build mode).

Downloading Handle

Specify URL for downloading, 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.

Debug options

Generally snapshot file is deleted after files collection. Set swabra.preserve.snapshot system property to preserve snapshots for debug purposes.


If you believe you've faced a bug: Issue Tracker (project: TeamCity)
If you want to ask a question or discuss: Forum

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

Related Materials

Issue in TeamCity tracker.

  • No labels