Overview
Project cleanup rules are used to define when historical build data is cleaned from the pulse™ host server. In a perfect world, the host would have enough disk space to retain all project build data forever. However, disk space is limited, and project data (particularly working directories) may consume hundreds of megabytes per build. Cleanup rules provide a flexible way of defining when data should be cleaned to preserve disk space.
Types of Project Data
For the purpose of cleanup, build data is split into two categories:
- The working directory for the build. This is the working copy checked out from the SCM, left in the same state as when the build completed. As the working directory will typically contain intermediate binary files, it may consume a large amount of space. For this reason, a default cleanup rule is put in place for all new projects that will clean up the working directory for builds more than 10 builds old. Retaining the working directory is useful for diagnosing build issues, so it is best to retain at least some working directories.
- The entire build result. This refers to all artifacts captured during the build, along with the build result stored in the pulse™ database. Usually this takes up significantly less space, and ideally would never need to be cleaned. However, if disk space is limited, cleaning build results may be necessary. In this case it is best to clean up successful results most aggresively, as they are usually of less future interest.
When configuring a cleanup rule, you can choose if it applies to working directories only or the entire build result. In the latter case, the working directory will also be cleaned, as it is no use without the rest of the build data.
Application of Cleanup Rules
Each project has a list of cleanup rules. After each build is completed, and at regular scheduled intervals, each one of these cleanup rules is applied to the project's build history in turn. Whenever a cleanup rule matches a build result, that result (or its working directory) will be immediately cleaned.
Creating Cleanup Rules
A new cleanup rule may be added to your project by clicking the "add new cleanup rule" link on the "configuration" tab for the project. You will need to choose what the rule applies to (working directories or entire results), and when it should be applied, in terms of the result state and a number of build results or a number of days.
 | Triggering Cleanups
When you have defined a new cleanup rule, it will not take effect until the next cleanup sweep. To force the rule to be applied immediately, trigger the rule using the "trigger" link in the corresponding row of the "cleanup rules" table. |
what
The what field specifies whether the cleanup rule applies to the working directory only or to the whole build result (see above).
restrict to builds with state(s)
You may optionally choose to restrict the cleanup rule to apply to builds that completed with one of a specified set of states. If no states are selected, the rule applies to all builds. If one or more states are chosen, the rule applies only to results that completed in that set of states.
retain for up to
Specifies for how long results that match the rule should be retained. The duration is specified in terms of a number of build results or a number of days. If a number of results is given, at most that many results will be retained, and if there are excess the oldest results will be cleaned. If a number of days is given, results more than that number of days old will be cleaned.
Modifying Cleanup Rules
Cleanup rules may be edited or deleted by clicking the "edit" or "delete" links in the row for the desired rule in the "cleanup rules" table.