aptly debian apt repository
# publis latest repos
for mirror in $(aptly mirror list -raw=true); do \
echo "# $mirror";
aptly publish snapshot $(aptly snapshot list -raw=true | grep "^${mirror}-[0-9]*$" | tail -n1);sleep 10;
done
# fetch mirrors/create snapshots
service aptly-api stop >/dev/null;sleep 5; su aptly -c 'aptly api serve'
service aptly-api stop >/dev/null;sleep 5; su aptly -c '/usr/local/bin/aptly_mirror_update.sh -s'
# SALT_CRON_IDENTIFIER:aptly_mirror_update
0 */12 * * * service aptly-api stop >/dev/null;sleep 5;su aptly -c '/usr/local/bin/aptly_mirror_update.sh -s';service aptly-api start >/dev/null
# aptly-publisher usage
aptly-publisher publish -c /etc/aptly-publisher.yaml --url http://127.0.0.1:8080
aptly-publisher publish --dists trusty/nightly -c /etc/aptly-publisher.yaml --url http://127.0.0.1:8080 -vv