Aptly REST API client and tooling
Aptly REST API client and useful tooling
Publisher is tooling for easier maintenance of complex repository management workflows.
This is how workflow can look like and what publisher can do for you:
First create configuration file where you define Aptly repositories, mirrors and target distributions for publishing.
mirror: # Ubuntu upstream repository trusty-main: # Base for our main component component: main distributions: - nightly/trusty # Mirrored 3rd party repository aptly: # Merge into main component component: main distributions: - nightly/trusty repo: # Some repository with custom software cloudlab: # Publish as component cloudlab component: cloudlab distributions: # We want to publish our packages (that can't break anything for # sure) immediately to both nightly and testing repositories - nightly/trusty - testing/trusty
Configuration above will create two publishes from latest snapshots of defined repositories and mirrors:
It expects that snapshots are already created (by mirror syncing script or by CI when new package is built) so it does following:
It can be executed like this:
aptly-publisher -c config.yaml -v --url http://localhost:8080 publish
Let’s assume you have following prefixes and workflow:
There can be more publishes under prefix, eg. nightly/trusty, nightly/vivid
Then you need to switch published snapshots from one publish to another one.
aptly-publisher -v --url http://localhost:8080 \ --source nightly/trusty --target testing/trusty \ publish
You can also specify list of components. When you have separate components for your packages (eg. cloudlab) and security (mirror of trusty security repository), you may need to release them faster.
aptly-publisher -v --url http://localhost:8080 \ --source nightly/trusty --target testing/trusty \ --components cloudlab security -- publish
Finally you are also able to promote selected packages, eg.
aptly-publisher -v --url http://localhost:8080 \ --source nightly/trusty --target testing/trusty \ --packages python-aptly aptly -- publish
You can see differences between publishes with following command:
aptly-publisher -v --url http://localhost:8080 \ --source nightly/trusty --target testing/trusty \ publish --diff
Example output can look like this:
When you are creating snapshots regularly, you need to delete old ones that are not used by any publish. It’s wise to call such action every time when publish is updated (eg. nightly).
aptly-publisher -v --url http://localhost:8080 cleanup
You can install directly using from local checkout or from pip:
python3 setup.py install pip3 install python-aptly
Or better build Debian package with eg.:
dpkg-buildpackage -uc -us
For usage informations, see aptly-publisher --help or generate and view man page.
PYTHONPATH=. help2man -n "aptly-publisher - tool for easy creation of Aptly multi component publishes" --version-string=$(grep version setup.py|cut -d '"' -f 2) "python3 aptly/publisher/__main__.py" | sed -e s,__main__.py,aptly-publisher,g -e s,__MAIN__.PY,APTLY-PUBLISHER,g > aptly-publisher.1 man aptly-publisher.1
Also see doc/examples directory.
For examples of jenkins jobs, have a look at tcpcloud/jenkins-jobs repository.