Note
This repository has moved to verifa/rt-retention
rt-retention
A JFrog CLI plugin to facilitate artifact retention in Artifactory.
TL;DR
Deletes artifacts matching all File Specs found in a given directory.
Allows for generation of FileSpecs files through Go templates and a JSON configuration file.
Installation
This plugin isn't currently hosted anywhere yet, so you'll be building it locally.
You can use the build.sh and install.sh scripts.
Usage
Commands
Templating
This plugins allows you to generate retention policies using Go templates and a JSON config file.
Templates
Templates use values from the JSON config file to generate FileSpec files.
delete-older-than.json:
{
"files": [{
"aql": {
"items.find": {
"repo": "{{.Repo}}",
"created" : {"$before" : "{{.Time}}"}
}
}
}]
}
JSON config
The JSON config file contains a key for each template, with an array of entries for that template.
Each entry will result in a FileSpecs file being generated.
If the entry has a Name property, it's value will be used as the FileSpecs file name.
config.json:
{
"delete-everything": [
{ "Name": "foo-dev", "Repo": "foo-dev-local" },
{ "Name": "bar-dev", "Repo": "bar-dev-local" }
],
"delete-older-than": [
{ "Name": "baz-dev", "Repo": "baz-dev-local", "Time": "30d" }
]
}