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 by creation time #73

Merged
merged 2 commits into from Jul 8, 2014

Conversation

Projects
None yet
2 participants
@queeno
Copy link
Contributor

queeno commented Jun 30, 2014

Users have now the choice of listing the snapshot by creation time as well as name (lexicographic / default behaviour).
An additional flag has been added '--sort=' which controls the sort strategy applied to the list produced by aptly snapshot list.

The possible values are:
--sort=name (default): sorts the snapshot list by name (lexicographic order)
--sort=time: sorts the snapshot list in chronological order (oldest to newest)

For example:

I've created the snapshots in the following order:

root@sim-tst-lb1:~# aptly snapshot create snap1 empty
...
root@sim-tst-lb1:~# aptly snapshot create rabbitmq from mirror rabbitmq
...
root@sim-tst-lb1:~# aptly snapshot create repo from repo local
...
root@sim-tst-lb1:~# aptly snapshot create elasticsearch from mirror elasticsearch
...

aptly snapshot list (-sort=name) produces the following output:

root@sim-tst-lb1:~# aptly snapshot list
List of snapshots:
 * [elasticsearch]: Snapshot from mirror [elasticsearch]: http://packages.elasticsearch.org/elasticsearch/1.2/debian/ stable
 * [rabbitmq]: Snapshot from mirror [rabbitmq]: http://www.rabbitmq.com/debian/ testing
 * [repo]: Snapshot from local repo [local]
 * [snap1]: Created as empty

To get more information about snapshot, run `aptly snapshot show <name>`.

aptly -sort=time snapshot list produces the following output:

root@sim-tst-lb1:~# aptly -sort=time snapshot list
List of snapshots:
 * [snap1]: Created as empty
 * [rabbitmq]: Snapshot from mirror [rabbitmq]: http://www.rabbitmq.com/debian/ testing
 * [repo]: Snapshot from local repo [local]
 * [elasticsearch]: Snapshot from mirror [elasticsearch]: http://packages.elasticsearch.org/elasticsearch/1.2/debian/ stable

To get more information about snapshot, run `aptly snapshot show <name>`.

The -raw behaviour stays unchanged:

root@sim-tst-lb1:~# aptly -sort=time -raw snapshot list
snap1
rabbitmq
repo
elasticsearch

Integration tests have been added.

List snapshots by time
Users now have the choice of listing the snapshot by time as well as
name (default behaviour).
An additional flag has been added '--sort=' which controls the sort
method applied to the list produced by aptly snapshot list.

The possible values are:
--sort=name (default): sorts the snapshot list by name (lexicographic
order)
--sort=time: sorts the snapshot list in chronological order (oldest to
newest)

@queeno queeno changed the title List snapshots by time List snapshots by creation time Jun 30, 2014

List snapshots by time: added integration tests
Added a couple of integration tests for the new list snapshot by
creation time feature.

@smira smira merged commit b4ea963 into aptly-dev:master Jul 8, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

smira added a commit that referenced this pull request Jul 8, 2014

smira added a commit that referenced this pull request Jul 8, 2014

smira added a commit that referenced this pull request Jul 8, 2014

@smira

This comment has been minimized.

Copy link
Member

smira commented Jul 9, 2014

Thanks a lot!

smira added a commit to aptly-dev/aptly-dev.github.io that referenced this pull request Jul 9, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment