ephemeral aptly server importing from s3

487 views
Skip to first unread message

jordan...@gmail.com

unread,
Nov 6, 2014, 1:49:40 PM11/6/14
to aptly-...@googlegroups.com
My use case is the following and was wondering if aptly has support for it yet:
1) create a machine that installs aptly
2) add and publish a .deb to s3 that may or may not exist on a private s3 bucket
3) repeat #2 for a while
3) then the local aptly server is destroyed

so effectively the s3 bucket is the source of truth for my repository and not the local aptly filesystem

What I'm currently doing is:
aptly repo create js-stable (one-time only)
aptly repo add js-stable $file_name.deb
aptly publish repo -distribution=js-stable --skip-signing js-stable s3:js-stable: (one-time only)
aptly publish update --skip-signing js-stable s3:js-stable:

What I think I need to do is:
aptly repo import js-stable (one-time only without a package name)
aptly repo add js-stable $file_name.deb
aptly publish update --skip-signing js-stable s3:js-stable:

It looks like `aptly repo import` needs a package name currently. I also thought about setting up a mirror but the docs say that mirrors don't support s3 private buckets currently?

Thanks for this awesome tool.

Andrey Smirnov

unread,
Nov 8, 2014, 8:51:38 AM11/8/14
to jordan...@gmail.com, aptly-...@googlegroups.com
Hi!

You scenario with "s3 bucket is the source of truth" is not quite easy with aptly right now. 

On your questions:
 1. aptly repo import accepts package query, so you can use "always true query" that would import all packages, e.g. `aptly repo import your-mirror your-repo Name` (here Name is query that says "Name" is not empty, which is always true).
 2. aptly supports private S3 buckets fully: set acl to 'private' in aptly configuration file when publishing (it is default).

To support your scenario with aptly, you might do something like that:
1. Create and update mirror of your S3 repo (this would require downloading all the packages).
2. Import all packages from the mirror into empty local repo.
3. Add your packages to the local repo.
4. Publish local repo back to S3.



--
You received this message because you are subscribed to the Google Groups "aptly-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aptly-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jordan...@gmail.com

unread,
Nov 8, 2014, 5:14:03 PM11/8/14
to aptly-...@googlegroups.com, jordan...@gmail.com
Andrey,
Thanks for your response. I have a short follow up. To do #2 "Import all packages from the mirror into empty local repo." Can I use `aptly repo import js-stable` with no package name to import all packages or do i need to list all packages and then import them over a loop?

Andrey Smirnov

unread,
Nov 9, 2014, 1:03:45 PM11/9/14
to aptly-...@googlegroups.com, jordan...@gmail.com
Hi!

`aptly repo import` takes 3 arguments: source mirror, destination local repo and package query.

If you'd like to import all the packages, use 'Name' as package query, it would match all the packages.

So you can't run it without package query, but you don't have to do import in the loop.  Just run it something like that:

  aptly repo import js-mirror js-repo Name

This command would import all packages from mirror js-mirror into local repo js-repo.

jordan...@gmail.com

unread,
Nov 10, 2014, 8:21:03 PM11/10/14
to aptly-...@googlegroups.com, jordan...@gmail.com
Andrey,
OK I follow that. It looks like from the change log aptly can't read a mirror from a private s3 bucket. I wanted to make sure this was the case since it's not explicit in the documentation. If there isn't support for mirrors from private s3 buckets is that planned on any up coming releases?
-Jordan

On Thursday, November 6, 2014 10:49:40 AM UTC-8, jordan...@gmail.com wrote:

Andrey Smirnov

unread,
Nov 11, 2014, 12:57:04 AM11/11/14
to jordan...@gmail.com, aptly-...@googlegroups.com
Yes, unfortunately aptly can mirror only from regular HTTP. I haven't tried it myself, but http://www.s3auth.com/ might help you.

Reply all
Reply to author
Forward
0 new messages