Package: aptly-ctl
aptly-ctl-- Convenient aptly API clientaptly-ctlis a command line tool for managingapltyrepositories remotely viaAPI. This tool tries to group most common repository operations into composite ones, more convenient for humans, and maintain ability to perform any atomic API request at the same time.aptly-ctlis built uponaptly-api-clientlibrary and MIT licensed.Featuresputsubcommand uploads deb package to aptly instance, adds it to specified local repo and updates all publishes that depend on that local repo;removesubcommand removes deb packages from local repos and updates publishes that depend on those repos;searchsubcommand is self-explanatory. Is searches usingaptly package query format;copysubcommand copies packages between local repos and updates dependent publishes;repoandpublishsubcommand are intended to perform atomic API operations like creation, deletion etc.Installation$pip3installaptly-ctlor from source code directory$python3setup.pyinstallUsageaptly-ctlhas the following config format:profiles:-name:localurl:http://localhost:8090/apisigning:gpgkey:"DC3CFE1DD8562BB86BF3845A4E15F887476CCCE0"passphrase:"secret"-name:remoteurl:http://user:password@remote:8090/apisigning:gpgkey:"maintainer@somerepo.org"passphrase_file:"/etc/aptly/gpg_pass"signing_overrides:"./stretch":skip:trueEachprofileelement describes configuration for one aptly instance. By default,aptly-ctluses the first one listed. To select profile, use-por--profileargument to select by position (e.g.-p 0,--profile 1), by name (e.g.--profile local) or by partial name match (-p lor-p rwould suffice for this case).urlis an aplty API endpoint to connect to.signingis a default signing config. It may containskip-- skip signing at all. Default:true;batch-- enable batch mode used when passing passphraze. Generally you want it alwaystrue. Default:true;gpgkey-- gpg key name (key fingerprint or email). No default;keyring-- gpg keyring file name local to server. Default: gpg defaults;secret_keyring-- gpg secret keyring file name local to server. Default: gpg defaults;passphrase-- gpg key passphrase. No default;passphrase_file-- gpg passphrase file local to server. No default.signing_overridesdictionary is optional and used to override default signing config for some publishes. Specify publish in form[<storage>:]<prefix>/<distribution>. Root prefix is.. Configuration is the same as forsigning.To specify config location use-cargument, or save it in one of the following locations (using the first found, searching from the first to the last):$HOME/aptly-ctl.yml;$HOME/aptly-ctl.yaml;$HOME/aptly-ctl.conf;$HOME/.aptly-ctl.yml;$HOME/.aptly-ctl.yaml;$HOME/.aptly-ctl.conf;$HOME/.config/aptly-ctl.yml;$HOME/.config/aptly-ctl.yaml;$HOME/.config/aptly-ctl.conf;/etc/aptly-ctl.yml;/etc/aptly-ctl.yaml;/etc/aptly-ctl.conf.Ifaptly-ctlcannot find config in listed locations, you can specify configuration keys on command line and still have a valid config which allows to runaptly-ctlwithout config at all. Specify them usging-C <key>=<value>argument, where<key>components are separated by a dot e.g.$aptly-ctl-C"url=http://localhost:8090/api"-C"signing.skip=true"repolistSomeaptly-ctlsubcommands print to STDOUT output parsable by other subcommands. Check out subcommand's--helpto get some hints on how to use it in conjunction with other ones.ExamplesSearch for a package containing 'nginx':$aptly-ctlsearch'Name (~ nginx)'"jessie_main_stable/Pamd64 nginx-full-dbg 1.9.9-2~didww+8.2 c89ebe5a0ac7e146""jessie_main_stable/Pamd64 nginx-full-dbg 1.10.0-0~didww+8.4 25d7ab9574e3de74""jessie_main_stable/Pamd64 nginx-full-dbg 1.10.1-0~didww+8.4 1cc12f74c9a28368""jessie_main_stable/Pamd64 nginx-light 1.9.9-2~didww+8.2 d34ac5a2789f3126""jessie_main_stable/Pamd64 nginx-light 1.10.0-0~didww+8.4 c154f10a23232451""jessie_main_stable/Pamd64 nginx-light 1.10.1-0~didww+8.4 3f9d1d3d63a569e6""jessie_main_stable/Pamd64 nginx-light-dbg 1.9.9-2~didww+8.2 ba326e19379f7be""jessie_main_stable/Pamd64 nginx-light-dbg 1.10.0-0~didww+8.4 a5069fb4d70aab16""jessie_main_stable/Pamd64 nginx-light-dbg 1.10.1-0~didww+8.4 b57b8645f8d17e26""jessie_main_stable/Pamd64 nginx-naxsi 1.9.9-2~didww+8.2 868e43c45e4f8493""jessie_main_stable/Pamd64 nginx-naxsi 1.10.0-0~didww+8.4 7a51d45d80536ce5""jessie_main_stable/Pamd64 nginx-naxsi 1.10.1-0~didww+8.4 907034c9442a2ca9""jessie_main_stable/Pamd64 nginx-naxsi-dbg 1.9.9-2~didww+8.2 3b51a3c9d9031da5""jessie_main_stable/Pamd64 nginx-naxsi-dbg 1.10.0-0~didww+8.4 9cb058b4ce84d690""jessie_main_stable/Pamd64 nginx-naxsi-dbg 1.10.1-0~didww+8.4 ccc5f79434c67dec""stretch_main_stable/Pamd64 libnginx-mod-http-auth-pam 1.12.0 78c35d6a10bead1""stretch_main_stable/Pamd64 libnginx-mod-http-auth-pam-dbgsym 1.12.0 3aca8eef59f9216""stretch_main_stable/Pamd64 libnginx-mod-http-cache-purge 1.12.0 ffe2d6f3c00a1dbe""stretch_main_stable/Pamd64 libnginx-mod-http-cache-purge-dbgsym 1.12.0 658e2d13463bf4ac"or$aptly-ctlsearch--namenginxRemove particular packages:$aptly-ctlremove\"stretch_main_stable/Pamd64 libnginx-mod-http-cache-purge-dbgsym 1.12.0 658e2d13463bf4ac"\"jessie_main_stable/Pamd64 nginx-light-dbg 1.9.9-2~didww+8.2 ba326e19379f7be"Verbosely upload packages from local file system to aptly, add them to specified repo and update it's publish:$aptly-ctl-vputstretch_mainpackages/*
INFOput(6860)Loaddedconfigfrom"/etc/aptly-ctl.yml"INFOput(6860)Runningputsubcommand.
INFOput(6860)Uploadingthepackagestodirectory"stretch_main_1537258123"INFOput(6860)Deletingdirectory'stretch_main_1537258123'."stretch_main/Pamd64 libnginx-mod-http-auth-pam 1.12.0 78c35d6a10bead1""stretch_main/Pamd64 libnginx-mod-http-cache-purge 1.12.0 ffe2d6f3c00a1dbe""stretch_main/Pamd64 libnginx-mod-http-dav-ext 1.12.0 1d4bed1e2358a7ad"INFOput(6860)Updatingpublishwithprefix".",dist"stretch"INFOput(6860)Updatedpublishwithprefix".",dist"stretch".Upload packages without config file (e.g. from CI server):$aptly-ctl\-C"url=http://user:pass@repo.example.org:8090/api"\-C"signing.gpgkey=me@example.org"\-C"signing.passphrase_file=/etc/gpg_pass"\putmy_repo*.debLeave only 2 most recent versions of a packagenginx-fullin repostretch_mainand do it verbosely:$aptly-ctl-vsearch-rstretch_main--rotate2nginx-full|aptly-ctl-vremove
INFOremove(6946)Loaddedconfigfrom"/etc/aptly-ctl.yml"INFOremove(6946)Runningremovesubcommand.
INFOsearch(6945)Loaddedconfigfrom"/etc/aptly-ctl.yml"INFOsearch(6945)Runningsearchsubcommand.
INFOsearch(6945)Searchinginreposstretch_main
INFOsearch(6945)Query:nginx-full
INFOremove(6946)Removed"Pamd64 nginx-full 1.13.4-1 6173d29295cbacab"fromstretch_main
INFOremove(6946)Removed"Pamd64 nginx-full 1.13.5-1 3b1dc91fbe2a9254"fromstretch_main
INFOremove(6946)Removed"Pi386 nginx-full 1.13.4-1 39fbaa9e4fcd58e3"fromstretch_main
INFOremove(6946)Removed"Pi386 nginx-full 1.13.5-1 2b3998898bb9e56d"fromstretch_main
INFOremove(6946)Updatingpublishwithprefix".",dist"stretch"INFOremove(6946)Updatedpublishwithprefix".",dist"stretch".Publish local repostretch_extra:$aptly-ctlpublishcreate-slocal--architecturesamd64extra/stretchstretch_extra=extra
extra/stretchSourcekind:localPrefix:extraDistribution:stretchStorage:Label:Origin:Architectures:amd64Sources:stretch_extra(extra)