Home / Platform management / DevOps toolchain / Tool Operations / Create an artifact cleanup policy

Create an artifact cleanup policy

As business grows, the artifacts produced by the pipeline are increasing, which leads to increased pressure on the artifact repository. The platform supports artifact cleanup policies, which can automatically clean up the artifact repository and reduce the pressure on the artifact repository by configuring artifact cleanup policies.

Cautions

Only one artifact cleanup policy can be created for each project under the same artifact repository, and it cannot be created repeatedly.

Prerequisites

You need to integrate the artifact repository in advance, see Integrate Tools .

Procedure

  1. In the left navigation bar, click DevOps Toolchain > Artifact Cleanup.

  2. Click to create an artifact cleanup policy.

  3. Configure Basic information. Refer to the following form to configure some parameters.

    Parameter Description
    Name Select the integrated artifact repository in the platform.
    Name The project name in the artifact repository tool.
  4. Configure Policy Settings. Refer to the following form to configure some parameters.

    Tip:

    • When the cleanup rule conflicts with the retention rule, the retention rule has a higher priority, that is, the artifacts matched by the cleanup rule will be retained.

    • Support adding multiple strategies, and the relationship between the added strategies is or.

    Parameter Description Note
    Apply to the repository Select or fill in the artifact repository under the tool project, and the strategy only takes effect on the current repository. Support filling in the exact repository name or regular expression.
    Cleanup Rules - TAG Match Strategy: Add one or more Tag matching rules, and the relationship between different Tag matching rules is or.
    - Clean up untagged artifacts: Untagged artifacts in the artifact repository will be cleaned up.
    The cleanup rules support Harbor Registry, Docker Registry, and JFrog Artifactory.
    Retention Rules
    - TAG Match Strategy: Add one or more Tag matching rules, and the relationship between different Tag matching rules is or.
    - Retained For (Pulled): Retain artifacts pulled in the last N days, and artifacts pulled more than N days ago will be cleaned up.
    - Retained For (Pushed): Retain artifacts pushed in the last N days, and artifacts pushed more than N days ago will be cleaned up.
    - Keeps (Pulled): Retain the latest N pulled artifacts, and artifacts beyond the retention limit will be cleaned up.
    - Keeps (Pushed): Retain the latest N pushed artifacts, and artifacts beyond the retention limit will be cleaned up.

    TAG Match Strategy supports Harbor Registry, Docker Registry, and JFrog Artifactory.
    Retention time and retention limit for pushed and pulled artifacts are configurable for Harbor Registry.
  5. After filling in the parameters, you can click on simulation execute in the lower left corner to preview and execute the results in a pop-up window.

  6. Click on Confirm to complete the creation of the artifact cleaning policy.