Policies configuration¶
Slice of policies to use during cleanup job.
policies:
-
name: "policy_docker"
repos:
- "docker-prod-local"
schedule: "*/30 * * * *"
retention: "2160h" # 90d
lastModified: true
lastDownloaded: true
docker:
keepSemver: true
exclude:
- "latest"
-
name: "policy_misc"
repos:
- "rpm-prod-local"
- "rpm-local"
- "generic-local"
schedule: "*/30 * * * *"
retention: "24h" # 1d
lastModified: true
lastDownloaded: true
common:
include:
- "prod/*"
exclude:
- "*2.2.*"
- "*2.1.0*"
name
¶
Name of the policy.
Config file
policies:
- name: "mypolicy"
Environment variables
ATFCLNP_POLICIES_<KEY>_NAME
repos
¶
A list of repositories to clean.
Config file
policies:
- name: "mypolicy"
repos:
- "rpm-prod-local"
- "rpm-local"
- "generic-local"
Environment variables
ATFCLNP_POLICIES_<KEY>_REPOS
schedule
¶
CRON expression to schedule this policy.
Config file
policies:
- name: "mypolicy"
schedule: "*/30 * * * *"
Environment variables
ATFCLNP_POLICIES_<KEY>_SCHEDULE
retention
¶
Interval duration to look back before deleting an artifact.
Config file
policies:
- name: "mypolicy"
retention: "24h"
Environment variables
ATFCLNP_POLICIES_<KEY>_RETENTION
lastModified
¶
Use last modified time of an artifact as retention
duration. (default true
)
Config file
policies:
- name: "mypolicy"
lastModified: true
Environment variables
ATFCLNP_POLICIES_<KEY>_LASTMODIFIED
lastDownloaded
¶
Use last downloaded time of an artifact as retention
duration. (default true
)
Config file
policies:
- name: "mypolicy"
lastDownloaded: true
Environment variables
ATFCLNP_POLICIES_<KEY>_LASTDOWNLOADED
common
¶
The common
type will apply to repositories via an AQL search query
with inclusion and exclusion fields. However, it will only concern repository types not currently managed by
Artifactory Cleanup such as generic
, maven
, npm
, rpm
and so on.
Config file
policies:
-
name: "mypolicy"
common:
include:
- "prod/*"
exclude:
- "*2.2.*"
- "*2.1.0*"
Environment variables
ATFCLNP_POLICIES_<KEY>_COMMON_INCLUDE
ATFCLNP_POLICIES_<KEY>_COMMON_EXCLUDE
Name | Default | Description |
---|---|---|
include |
List of items matching an expression to include | |
exclude |
List of items matching an expression to exclude |
docker
¶
The docker
type will be only applied to docker
package type repositories on Artifactory. It will work differently
from the common
type because of the particular structure of a registry. Indeed only the Docker tags will be analyzed
during the cleanup process.
Config file
policies:
-
name: "mypolicy"
docker:
keepSemver: true
exclude:
- "latest"
Environment variables
ATFCLNP_POLICIES_<KEY>_DOCKER_KEEPSEMVER
ATFCLNP_POLICIES_<KEY>_DOCKER_EXCLUDE
Name | Default | Description |
---|---|---|
keepSemver |
Do not remove tags matching a semver compliant pattern | |
exclude |
List of tags matching an expression to exclude |
Created: 2020-09-24 14:21:34