Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List snapshots for specific repository? #1202

Open
jamesps-ebi opened this issue Jul 25, 2023 · 1 comment
Open

List snapshots for specific repository? #1202

jamesps-ebi opened this issue Jul 25, 2023 · 1 comment
Assignees

Comments

@jamesps-ebi
Copy link

Detailed Description

It doesn't look like there is any way to list snapshots belonging to a specific aptly repository/distribution.
I think this would be very useful if you are managing multiple repositories.

Context

Example use-case,
You maintain your own 'local' repo and a 'local-security' repo. You want to automate creation and pruning of snapshots i.e max 14 of each.
If there was a command-line switch to do separate snapshots belonging to each, we could script a cleanup job to purge old snapshots.

# example - Would only list snapshots for the given REPOSITORY
aptly snapshot list [REPOSITORY]

Possible Implementation

Your Environment

@r4co0n
Copy link

r4co0n commented Jul 28, 2023

This is not a solution, but a workaround that has served us quite well so far: Name your snapshots after aptly type and item name, e.g., name your bookworm mirror snapshot mirror_bookworm, and the publication(publish) snapshot publish_bookworm (We used publication).

Then, the question "Which snapshots belong to this mirror or publication?" becomes quite easy to answer. You will still need to make sure to not hande bookworm-backports when calling for bookworm, but this can be easily solved - If anyone struggles with this part, please reach out again.

P.S. You might feel that duplicating snapshots from mirror_ to publish_ is an unnecessary abstraction, but it will allow you to change how your publication is composed without losing its history. We happily use this abstraction, though it is probably a bit more cumbersome than strictly necessary.

Btw, simply copying a snapshot can be accomplished by calling aptly snapshot merge with a single <source> argument.

@neolynx neolynx self-assigned this Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants