Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

This page describes the cleanup functionality which is available from version 1.9.2

Table of Contents

...


Every build that is executed within Continua CI stores information in the server's workspace, such as artifacts and build logs, and entries in the database. 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 and have a negative impact on database performance. Cleanup settings and rules define when any unneeded or old build files and data should be removed, which reduces the amount of disk space that Continua CI is currently using.

Overriding cleanup policies

 

There are cleanup settings and daily cleanup rules. Generally, the settings specify when cleanup should run, and the rules define which aspects of which builds should be cleaned up on a daily basis.  Cleanup settings and one or more rules Cleanup policies can be defined at all three levels of Continua CI.

Table of Contents

Global Cleanup

The global settings and rules can be found in the Administration section, under Continuous Integration.

Image Added

The Cleanup Settings and Daily Cleanup Rules on this page will apply to all configurations unless they are overridden for a project or configuration, 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.

Excluding special builds from the cleanup

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.

Defining and manually running cleanup policies

Cleanup policies can be defined and manually executed in following areas of Continua:

Global Cleanup Policy

is set to run at midnight and the agent workspace is set to be cleaned up for all build results, and there is one default daily cleanup rule which is set to remove other server workspace files (e.g. not artifacts or build logs) for builds older than 90 days, skipping a minimum of 10 latest builds. If the number of existing builds is greater than 100 then the oldest builds will be deleted.

See Cleanup Settings of more information on editing settings and Daily Cleanup Rules for more details on editing rules.

A list of projects and configurations which override the global cleanup settings or any of the global daily cleanup rules are listed in the Overrides section on this page.

You can also manually run the cleanup rules for every configuration from this page by clicking on the Run Cleanup Now button (or the Save & Run Cleanup Now button if there are any unsaved changes to save first)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 insteadsettings or rules then the overriding settings and rules will apply when running the cleanup.

Project Cleanup

...

A project's cleanup policy can be settings and rules are defined in it's its project wizard. The project wizard can be found by selecting a project and clicking 'Edit Project' in the Tasks menu. The cleanup policy Cleanup is the fifth page step in the project wizard. 

Image Added


The Cleanup Settings and Daily Cleanup Rules on this page will apply to all configurations in the project unless they are overridden for a configuration. By default, the project cleanup inherits all settings and rules from the global cleanup.

See Cleanup Settings of more information on overriding and editing settings and Daily Cleanup Rules for more details on adding, overriding and editing rules.

A list of configurations which override the project cleanup settings or any of the project daily cleanup rules are listed in the Overrides section on this page.

You can also manually run the cleanup policies rules for every configuration in a the project from this page by clicking on the Run Cleanup Now button (or the Save & Run Cleanup Now button if there are any unsaved changes to save first). Note that if a configuration has overridden the current cleanup policy, then that cleanup policy will be used instead. Alsoproject or global cleanup settings or rules then the overriding settings and rules will apply when running the cleanup. Also, if a project uses the global cleanup policy, then the global policy will be run against the current project inherits global settings or rules and they are not overridden then those settings and rules will apply to each configuration when you manually run a cleanup.

Configuration Cleanup

...

A configuration's cleanup policy is settings and rules are defined in it's its configuration wizard. It can be found by editing the configuration and navigating to the Cleanup section of the wizard

Image Added


The Cleanup Settings and Daily Cleanup Rules on this page will apply the current configuration. By default, the configuration cleanup inherits all settings and rules from the global cleanup.

See Cleanup Settings of more information on overriding and editing settings and Daily Cleanup Rules for more details on adding, overriding and editing rules.

You can also manually run the cleanup policy rules for a single configuration from this page . Note by clicking on the Run Cleanup Now button (or the Save & Run Cleanup Now button if there are any unsaved changes to save first). Note that if a configuration uses the inherits global or project cleanup policy, then that policy will be run against settings or rules and they are not overridden then those settings and rules will apply to the current configuration when you manually run a cleanup.

Cleanup Policy Options

Image Removed

Server Cleanup Policy

Run cleanup task daily at

Specify when the cleanup should execute each day.

Build age

All builds that are older than the build age will be removed when the cleanup runs. 

Minimum builds

This specifies the minimum number of builds that should be kept at all times, regardless of build age.

Maximum builds

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.

What to cleanup

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.

  • Artifacts: This will delete all artifacts in the server workspace for each build. Once artifacts have been deleted, they are no longer accessible through the build's artifacts page
  • Logs: This will delete all build logs in the server workspace for each build. Once logs have been deleted, they are no longer accessible through the build's log page.
  • Other Files: This will delete any other files copied to the server workspace for each build via the workspace rules.

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.

  • Unit Tests: This will remove all unit tests associated with each build. Once unit tests have been deleted, they are no longer accessible through the build's unit tests page
  • Build: This will delete the main entry for each build from the build table and it child tables in the database. Once a build entry has been deleted, the build is no longer accessible through any of the build's pages and will no longer appear on the history or activity page. Selecting this, will automatically select the Unit Tests option and all Workspace options.
  • Statistics: This will remove statistics entries associated with each build so they will no longer contribute to the configuration's statistics and metrics. Selecting this, will automatically select all other options.

Agent Cleanup Policy

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.

Saving the Policy

Save:  Save the cleanup policy, leaving the cleanup to run at the time specified.


Info
Note that pinned builds are marked as important. This means that they are excluded from the daily cleanup and can never be deleted by the daily cleanup rules

...