gogoair / lavatory

Tooling to define repository specific retention policies in Artifactory.
Apache License 2.0
21 stars 14 forks source link

Refactor/time based retention #11

Closed ndcampbell closed 6 years ago

ndcampbell commented 6 years ago

This adds time based retention with the ability to add extra AQL. So the plugin could look like:

def purgelist(artifactory):
    extra_aql = [{"@deployed": {"$match": "dev"}}, {"@deployed": {"$nmatch": "prod"}}]
    purgable = artifactory.time_based_retention(keep_days=120, extra_aql=extra_aql)
    return purgable

I tried to abstract out the AQL for a while but it just got more and more complicated. Adding raw AQL terms like this is the cleanest way if you want to do this against specific properties