/teamcity-caches-cleanup-plugin

Clean up Maven and Gradle caches to free TeamCity Agent disk space

Primary LanguageKotlinApache License 2.0Apache-2.0

team project

TeamCity Caches Cleanup Plugin

About

A simple plugin, that helps to get free space for builds by deleting:

  • ~/.m2/repository
  • ~/.gradle/caches
  • ~/.npm (on Posix) or %AppData%/npm-cache (on Windows)
  • arbitrary directories defined in teamcity.cleaners.configurable.directories property (comma-separated, ~/ replaced with home directory)
  • or ~/.ivy2/cache

folders. These locations are known to grow very large over time, especially on long-living build agent.

Also it provides a simple cache with following properties:

  • it can be used by build steps via reference to system.agent.persistent.cache TeamCity parameter
  • it survives agent restarts
  • it will be cleaned if free space is required. Top level folders will be deleted one by one based on last update time, until enough space is free.

Warning!

⚡ This plugin will delete files from build agent!

Build

  • CI status:
* To build locally, checkout and run `mvn package`

Install

Just drop zip target\caches-cleanup-plugin.zip into <TeamCity_data_dir>/plugins