Every build that is executed within Continua CI stores information in the server's workspace, such as artifacts and build logs. These by-products are vital for executing your build process and tracking build information, however they can also take up considerable disk space over time. Cleanup policies provide a way to remove any unneeded or old build data, which reduces the amount of disk space that Continua is currently using.
Cleanup policies can be defined at all three levels of Continua CI, which are the global, project and configuration level. By default, the global cleanup policy is applied to every configuration in Continua CI, however these can be overridden on either the project or configuration levels. If a project defines a cleanup policy, then every configuration that belongs in that project will automatically inherit the project's cleanup policy rather than the global policy.
Each cleanup policy runs once per day. You can choose when it runs and control which builds and by-products are cleaned up. Every time the cleanup policy is run it will also apply the cleanup settings to previously cleaned up builds. For example, say your policy only removes the build log and you then change this so that it cleans up every aspect of old builds. By running the cleanup policy again, it will remove all old builds, regardless of whether their build log has already been cleaned up.
Note that build cleanup is permanent and a cleaned up build cannot be recovered.
Builds can be excluded from the cleanup process so that they will never be deleted. Pinned builds are marked as important so they will be ignored when the cleanup policy is run. Check out the Builds page for more information on pinned builds including how to pin builds.
Cleanup policies can be defined and manually executed in following areas of Continua:
The global policy can be found in the administration section, under the Continuous Integration (CI) Settings. You can manually run the cleanup policies for every configuration from this page. Note that if a configuration or project has overridden ,the global cleanup policy then that cleanup policy will be used instead.
A project's cleanup policy can be defined in it's project wizard. The project wizard can be found by selecting a project and clicking 'Edit Project' in the Tasks menu. The cleanup policy is the fifth page in the project wizard.
You can manually run the cleanup policies for every configuration in a project from this page. Note that if a configuration has overridden the current cleanup policy, then that cleanup policy will be used instead. Also, if a project uses the global cleanup policy, then the global policy will be run against the current project when you manually run a cleanup.
A configuration's cleanup policy is defined in it's configuration wizard. It can be found by editing the configuration and navigating to the Cleanup section of the wizard.
You can manually run the cleanup policy for a single configuration from this page. Note that if a configuration uses the global or project cleanup policy, then that policy will be run against the current configuration when you manually run a cleanup.
Specify when the cleanup should execute each day.
All builds that are older than the build age will be removed when the cleanup runs.
This specifies the minimum number of builds that should be kept at all times, regardless of build age.
This specifies the maximum number of builds that should be kept at any one time, regardless of build age. If the number of existing builds is greater than this number then the oldest builds will be deleted.
Workspace : Tick this to cleanup all the files in the server workspace for each build. Alternatively, you may wish to specify the types of files to cleanup from these sub-categories.
Database: Tick this to completely cleanup all database entries for each build. Alternatively, you may wish to choose to cleanup specific entries associated with the build in the sub-categories below.
The agent workspace folder for each build gets cleaned up every time the Server Cleanup runs on that build. It can also be set to be cleaned up immediately when each build completes using the agent cleanup policy. You can optionally select one or more build results which will trigger an agent workspace cleanup.
Save: Save the cleanup policy, leaving the cleanup to run at the time specified.
Save & Run Cleanup Now: Save the cleanup policy and run the cleanup immediately.