Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Cleanup strategy to preserve all recommended builds #3475

robinshen ADMIN ·
The built-in strategy in QuickBuild only supports to preserve certain amount or days of builds. Sometimes it is necessary to preserve all recommended builds also. In this case, turn off the default cleanup strategy, and schedule a maintenance configuration running below script:

groovy:
def confToCleanup = system.getConfiguration("path/to/conf_for_cleanup");
def daysToPreserve = 7;
for (eachBuild in system.buildManager.getBuilds(confToCleanup)) {
if (System.currentTimeMillis() - eachBuild.beginDate.time > daysToPreserve*24*3600*1000L && !build.recommended)
system.buildManager.delete(eachBuild);
}
  • replies 0
  • views 3104
  • stars 1