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?
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
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