View Source

h1. Situation
QuickBuild ships with two build auto-cleanup strategies of a configuration:
# To reserve builds by certain number of days.
# To reserve certain number of builds.

However sometimes this is not enough. For instance, you may want that recommended builds never get deleted automatically while other builds follow the normal auto-cleanup strategy. The solution is to define maintenance configuration running at descired schedule running customized script to do the cleanup.

h1. Demonstration
# Visit the [demo configuration|http://demo.pmease.com/overview/127], and hit the run button several times to generate more than five builds.
# Mark eldest build of the [demo configuration|http://demo.pmease.com/overview/127] as recommended if it is not.
# Visit the [demo cleanup configuration|http://demo.pmease.com/overview/128], and hit the run button to perform cleanup for the demo configuration. The cleanup is intended to preserve latest three builds, with recommended builds remaining intacted.
# After cleanup, check the [demo configuration|http://demo.pmease.com/overview/127], and you will find that all recommended builds are still there, but only latest three builds of other statuses are preserved.

h1. Resolution
# Switch to [step setting of the demo cleanup configuration|http://demo.pmease.com/settings/128/steps]. The master step is defined to execute a groovy script. The script loops over all builds of the demo configuration and delete all builds matching two conditions: not a recommended build and not the most recent three builds.
# The demo cleanup configuration is also scheduled to run every night at 1:00AM to do the job automatically.