sonatype-nexus-community / nexus-repository-apt

A Nexus Repository 3 plugin that allows usage of apt repositories
Eclipse Public License 1.0
105 stars 50 forks source link

Feature Request: Cleanup Task #115

Closed exabrial closed 5 years ago

exabrial commented 5 years ago

So fi you're using CI, you'll like build a ton of pre-release packages. It would be awesome if there was a feature to clean these up.

Maven2 repositories have a task you can schedule to delete snapshots on a regular basis.

johnmichaellien commented 5 years ago

I've only been using this specific plugin for a few days, but I think I've gotten around this by having my CI call a shell script during the upload process to also run the following

curl -I -u user:pass -X DELETE http://nexus:8081/repository/repo/snapshots/release123 curl -I -u user:pass -X MKCOL http://nexus:8081/repository/repo/snapshots/release123

exabrial commented 5 years ago

So we solved this by naming our apt packages properly. If you name your snapshot releases aka pre-releases in the apt world properly, the setting "asset history limit" will only keep that number of pre-release packages around.

Pretty cool feature, already built in! Just remember to setup a task to compact your blob store if you haven't already.