Aptly is software for managing apt repositories.
-
Quick package addition / removal.
-
Snapshotting of repository states with good repo diffing.
-
Repository publishing
-
distribution / architecture management
-
Convenient repository mirroring with strong filtering
-
Dependency management for package imports from other repositories.
-
dpkg-scanpackages is the simplest approach to package repository creation. It will scan for recursively scan for packages and generate the appropriate Packages file but does not assist in gpg signatures or laying out debs in a pool structure.
-
reprepro is a more full featured repository management tool with the ability to assist in maintaining a pool structure for your repository, db backed packages file generation, multiple distribution management, and assistance in signing releases. It does not have aptly's mirroring or snapshotting features.
We build packages for our staging environment on every merge into master. Once the packages have been built, we update the repository.
Once the staging packages are made, jenkins will run ansible on the staging servers, automatically bringing us up to the latest code. Once this code has been tested and validated as good and users are comfortable with a production deploy, the staging packages are synced to an s3 repository used by our production servers. Ansible can then be triggered via jenkins to update the production code base.
-
dpkg-scanpackages, our previous repo management tool, can take minutes to scan through large repositories and generate appropriate information for a Packages file.
-
parallel builds can result in available packages changing in the middle of a dpkg-scanpackage run, so package updates needed to be coordinated to avoid generating incorrect Packages files. Avoiding races is never fun.
aptly repo create --comment "coolest repo ever" \
--distribution "staging" --component "main" "my_repo"
aptly repo add staging some_deb.deb
aptly publish repo --gpg-key "0DF43F03" --architectures "amd64,i386" my_repo
aptly snapshot create snapshot1 from repo my_repo
$ aptly snapshot diff snapshot1 snapshot2
Arch | Package | Version in A | Version in B
+ all | ipython | - | 2.3.0-1
+ all | libgdal-doc | - | 1.11.0-15pl
+ all | python-django-waffle | - | 0.10
+ all | python-docutils | - | 0.11-1
+ all | python-dotenv | - | 0.0.2
+ all | python-dotenv | - | 0.0.2-1
+ all | python-elasticsearch | - | 1.2.0
+ all | python-execnet | - | 1.1
+ all | python-execnet | - | 1.1-1
+ all | python-flask | - | 0.10.1
+ all | python-flask | - | 0.10.1-1
-
Our aptly ansible playbook in planet_roles