Multi-Distribution issue: aptly provides trusty packages on xenial

247 views
Skip to first unread message

johanne...@googlemail.com

unread,
Jan 12, 2017, 8:38:33 AM1/12/17
to aptly-discuss
Hey there aptly users,
I have an issue with aptly and a mutli-distribution setup. I need to support ubuntu trusty and xenial targets, thus my application packages are provided distribution specific, e.g. myapp_0.1.3~Ubuntu~xenial_amd64.deb. Unfortunately once imported and published with aptly I see both packages, the xenial and trusty version regardless on which ubuntu distribution.

I'm certainly doing it wrong, here's how:

# import packages
curl -X POST -F file=@build-deb/myapp_6.0.0~Ubuntu~trusty_amd64.deb http://aptly/api/files/myapp_6.0.0
curl -X POST -F file=@build-deb/myapp_6.0.0~Ubuntu~xenial_amd64.deb http://aptly/api/files/myapp_6.0.0
curl -X POST http://aptly/api/repos/myrepo/file/myapp_6.0.0
# publish
curl -X DELETE http://aptly/api/publish/myrepo/trusty
curl -X DELETE http://aptly/api/publish/myrepo/xenial
curl -X POST -H 'Content-Type: application/json' --data '{"SourceKind": "local", "Sources": [{"Name": "myrepo"}], "Distribution" : "trusty", "Signing" : { "Skip" : false, "Batch" : true, "GpgKey" : "me@my-aptly", "Passphrase" : "***" } }' http://aptly/api/publish/:myrepo
curl -X POST -H 'Content-Type: application/json' --data '{"SourceKind": "local", "Sources": [{"Name": "myrepo"}], "Distribution" : "xenial", "Signing" : { "Skip" : false, "Batch" : true, "GpgKey" : "me@my-aptly", "Passphrase" : "***" } }' http://aptly/api/publish/:myrepo
# query result
apt-get update
apt-cache policy myapp
myapp:
Installed: (none)
Candidate: 6.0.0~Ubuntu~xenial
Version table:
6.0.0~Ubuntu~xenial 500
500 http://aptly/public/myrepo xenial/main amd64 Packages
6.0.0~Ubuntu~trusty 500
500 http://aptly/public/myrepo xenial/main amd64 Packages
# my sources.list on xenial
cat /etc/apt/sources.list | grep aptly
deb http://aptly/public/myrepo xenial main

Any idea what I need to fix?

Bernd Naumann

unread,
Jan 12, 2017, 11:28:05 AM1/12/17
to aptly-discuss
Hi,

(I do not use the API), but do you just use ONE repo for booth distributions? So you publish only one distribution, but two times with a different "distribution" flag?

(On our setup we have one aptly repo for each component, for each distribution; and then publish one distribution with all its compoennts repos.

Excerpt from our script:

aptly "${CONFIG_ARG}" -architectures="amd64,i386" publish repo "${GPG_KEY_ARG}" -distribution="sprd-trusty" -component="main,dependencies,contrib,multiverse" "sprd-trusty-main" "sprd-trusty-dependencies" "sprd-trusty-contrib" "sprd-trusty-multiverse" "sprd-trusty"

aptly "${CONFIG_ARG}" -architectures="amd64,i386" publish repo "${GPG_KEY_ARG}" -distribution="sprd-xenial" -component="main,dependencies,contrib,multiverse" "sprd-xenial-main" "sprd-xenial-dependencies" "sprd-xenial-contrib" "sprd-xenial-multiverse" "sprd-xenial"

Does that may answer your question?

Bernd
--
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-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

johanne...@googlemail.com

unread,
Jan 13, 2017, 4:38:11 AM1/13/17
to aptly-discuss
Hi Bernd,

I guess it is exactly as you say. I wanted to have one repo for both distributions but I can see that my way of doing it probably isn't right.

What I really would like to achieve is this:
- One url for the apt repository/apt server
- Support for two distributions (trusty and xenial)
- Support for three different 'flavours', like a different set of packages (or package versions) for development (like nightly builds), staging (more stable) and production (released by QA)

So my initial idea was this, in terms of sources.list contents:
- deb http://aptly/public/myrepo <distribution> <flavour>
- deb http://aptly/public/myrepo [trusy|xenial] [develop|staging|production]

I tried to realise this by using aptly with one repo and different distributions (not yet supporting components for flavours). But since you use separate repositories for each distribution and each component I may need to give this approach a try.

Thanks for your input.

Regards
Johannes

Bernd Naumann

unread,
Jan 13, 2017, 6:56:15 AM1/13/17
to aptly-...@googlegroups.com
Hello again,

On 01/13/2017 10:38 AM, johannes.layher via aptly-discuss wrote:
> Hi Bernd,
>
> I guess it is exactly as you say. I wanted to have one repo for both
> distributions but I can see that my way of doing it probably isn't
> right.

(I have one aptly config for each "release"/codename (precise, trusty,
and xenial) because I encountered 3rd party repos which provide the
_same_ package with different hashsums for the various releases, and
then aptly goes "boom", when it trys to handle these packages in the
pool. If you have external resources, you can think about it, but
obviously that should be fixed "upstream", but isn't).

>
> What I really would like to achieve is this: - One url for the apt
> repository/apt server - Support for two distributions (trusty and
> xenial) - Support for three different 'flavours', like a different
> set of packages (or package versions) for development (like nightly
> builds), staging (more stable) and production (released by QA)

One url would be cool, but I didn't achived that, too. The publish
prefix is the reason why, I think...

@andrey, is there a way to do this? Like Ubuntu or Debian do it?

For the /flavors/ its the same I guess: I got it work as its own repo
with its own publish and its own "distribution", to get a "-testing" and
"-daily" /branch/. And then later packages are moved manualy from a
testing repo the the "stable".

>
> So my initial idea was this, in terms of sources.list contents: - deb
> http://aptly/public/myrepo <distribution> <flavour> - deb
> http://aptly/public/myrepo [trusy|xenial]
> [develop|staging|production]
>

Mhm I have seen some repos which /abuse/ components for versioning. I
still don'nt know if this is clever or dirty.
Does have someone else an inside or thought about that? (Some examples:
mongoDB uses crazy components for versioning like
precise/mongodb-org/3.0, and nodeJS different url like
deb.nodesource.com/node_5.x)

> I tried to realise this by using aptly with one repo and different
> distributions (not yet supporting components for flavours). But since
> you use separate repositories for each distribution and each
> component I may need to give this approach a try.
>

One reason for this is, that I merge some 3rd party reppos into our own
, and I did not find a way to move packages between components, so I did
it that way.

> Thanks for your input.
>
> Regards Johannes
>

Your welcome,
good luck!
Bernd

signature.asc

johanne...@googlemail.com

unread,
Jan 13, 2017, 12:11:32 PM1/13/17
to aptly-discuss, bernd....@spreadshirt.net
Hey Bernd,

thanks again for your input.

I ended up with six different repositories [xenial|trusty] * [development|staging|production]. With the help of the mighty package query syntax I am able to easily copy the packages from development to staging to production, create a snapshot and publish it.

It's not pretty - I would rather have aptly support debian/ubuntu style distributions from the same repo - but it works.

Regards
Johannes

Reply all
Reply to author
Forward
0 new messages