Bamboo 3.4 : Configuring Expiry of a Plan's Job Build Results

By enabling build expiry for a Plan, you can choose what Job build result data* will be kept for a Plan and for how long this data will be kept (e.g. for reporting purposes), before Bamboo automatically deletes it.

* 'Job build result data' refers to all Job builds of a given Plan's build.

If you disable build expiry, your Plan's Job build result data will never be automatically deleted from your Bamboo server.

You can enable/disable build expiry for:

  • all plans (see Configuring Global Expiry of Job Build Results). This is generally the easiest way to manage build expiry in Bamboo. Your settings will apply to all Plans that do not have individual build expiry settings.
  • individual plans (as described below). You would generally only do this if there is a specific reason to keep/delete a particular Plan's Job build result data.

(tick) You can also delete the results of a Plan build manually — see Deleting the Results of a Plan Build.

The build expiry event is a global event that runs periodically, regardless of whether you disable or enable build expiry in your Plans. When this event occurs, the build results for your Plan will be expired according to the criteria specified in the settings above or globally. To configure the global event and global build expiry settings, please refer to Configuring Global Expiry of Job Build Results.

Enabling the Expiry of Job Build Results

Before you begin:

  • Ensure that you back up your build results data before its expiry date is reached.

To enable and configure the expiry of Job build result data for a Plan:

  1. Navigate to the configuration for the desired Plan, as described on Editing a Plan.
  2. Click the 'Miscellaneous' tab to display the Plan's current build expiry settings.
  3. Select the 'Override global build expiry configuration' check box. The following fields will be displayed:
    1. 'What should be expired?:' — select:
      • 'Build result' — if you want to delete all build results data (including artifacts and build logs). If you choose this option, the following two options are automatically selected.
      • 'Artifacts' — if you want to selectively delete all user-defined artifacts of Jobs in this Plan but keep all other Job build result data (such as build logs).
      • 'Build Logs' — if you want to selectively delete all build logs of Jobs in this Plan but keep all other Job build result data (such as artifacts).
    2. In the Expiry criteria section, use one of the follow three criteria to determine how much Job build result data to keep, by modifying the 'Expiry period' and 'Minimum builds to keep' fields accordingly:
      (warning)In this section, 'Job build results' could refer to artifacts, build logs or both (depending on what you specified in the previous substep).
      • To keep all Job build results of this Plan up to a certain age,
        (warning) With this method, older Plans could have all their build results deleted.
        • In the 'Expiry period' field, specify the number of months/weeks/days for which you want to keep your Job build results of this Plan. E.g. specify '24 months' to keep all Job build results for the last two years.
        • In the 'Minimum builds to keep' field, specify '0'.
      • To keep a specified (or minimum) number of Job build results of this Plan,
        • In the 'Expiry period' field, specify '0'.
        • In the 'Minimum builds to keep' field, specify the number of Job build results of this Plan you want to keep. E.g. specify '50' to keep the latest 50 Job build results.
      • To keep all Job build results of this Plan up to a certain age anda minimum number of these Job build results,
        • In the 'Expiry period' field, specify the number of months/weeks/days for which you want to keep your Job build results of this Plan. E.g. specify '24 months' to keep all Job build results for the last two years.
        • In the 'Minimum builds to keep' field, specify the number of Job build results of this Plan you want to keep. E.g. specify '50' to keep the latest 50 Job build results.
          (Hence, even if all Job builds of this Plan are over two years old, the last 50 Job build results will not be deleted.)
    3. If you wish to keep Job build results with particular labels, select the 'Don't expire builds with certain labels' check box. The 'Labels to keep' field will be displayed:
      • In the 'Labels to keep' field, specify any labels which match the labels applied to Job builds you want to keep. (If you want to specify more than one label, use spaces to separate them.) For any build label(s) specified(not plan labels or job labels), all Builds of this Plan which have a matching label(case insensitive) will never be deleted, regardless of the Minimum builds to keep and Labels to keepsettings.

        Please note, builds can either be labelled:

  4. Click the 'Save' button to save your changes.

Screenshot above: 'Enabling Build Expiry'

Disabling the Expiry of Job Build Results

To disable expiry of the Job build result data for a Plan:

  1. Navigate to the configuration for the desired Plan, as described on Editing a Plan.
  2. Click the 'Miscellaneous' tab to display the Plan's current build expiry settings.
  3. Select the 'Override global build expiry configuration' check box.
  4. Enter '999999999 months' in the 'Expiry Period' field.
    (info) This is a workaround for this existing Bamboo issue (BAM-4270). Please vote for this issue, if you would like to see it implemented in Bamboo.
  5. Click the 'Save' button to save your changes.

Screenshot above: 'Disabling Build Expiry'

Notes

Related Topics

Editing a Plan
Configuring Global Expiry of Job Build Results