aptly icon indicating copy to clipboard operation
aptly copied to clipboard

Improvement: Provide a real snapshot 'clone' functionality

Open gittygoo opened this issue 7 years ago • 2 comments

Add the functionality to create a "clone" of an existing snapshot

Detailed Description / Context

We currently have one production repository (A merge of multiple other snapshots of external repositories) and many times want to try a new package out. Initially we started by creating a "merge" of our production repo with a second repo that would contain just the new package, however this would quickly end up in a tangle since this new merge will be a "Child" of the production repo. Hence whenever we wanted to perform other actions on production we would have to first get rid of all these "Child" merges and then recreate them (if needed)

Possible Implementation

At the moment we do the following:

  • Get the list of the snapshots that compose the "Production" merge snapshot: -- Example command: aptly snapshot show production | grep snapshot | awk '{print $1}' | sed ':a;{N;s/\n/ /};ba'
  • Create a new merge snapshot of all these snapshots under a different name (ex: "production-new") aptly snapshot merge -latest production-new trusty-main-17042018211321 trusty-updates-17042018211321 trusty-security-17042018211321
  • We believe this can be automated with a simple "clone" command, Ideally a command like this should exist: aptly snapshot clone production production-new

gittygoo avatar Jul 30 '18 12:07 gittygoo

@gittygoo would you like a clone to have no relationship with source snapshot if I got you correctly? and should it retain same relationships with source snapshot's parents?

In other words, when cloning a snapshot, obviously contents of the snapshot are preserved, but what about links to the parent snapshot?

smira avatar Jul 31 '18 21:07 smira

Exactly:

  • no relationship with the snapshot it is cloning
  • but same relationship with its parent snapshots

gittygoo avatar Jul 31 '18 21:07 gittygoo