From 751497a748397ea267d31d00bd23f8b9dc286475 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 30 Jun 2016 16:44:22 -0700 Subject: [PATCH] aptly script --- linux-build-farm/README.md | 2 ++ linux-build-farm/aptly.sh | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 linux-build-farm/aptly.sh diff --git a/linux-build-farm/README.md b/linux-build-farm/README.md index c55e73000..c0c8325f9 100644 --- a/linux-build-farm/README.md +++ b/linux-build-farm/README.md @@ -4,3 +4,5 @@ Dockerized Linux Build Farm This subfolder contains Dockerfiles and a script to build Linux packages for a variety of Linux distributions. It's also an excellent way to test your CPU fans and stress test your disk. Running `build.sh` with no arguments builds everything. You can run `build.sh` with the name of a distro (e.g. centos-7) to only build that. Both 32 and 64 bit packages are built except where no 32-bit version of the distribution exists. + +The `aptly.sh` script creates Debian repositories with *aptly*. You will need it installed. Be careful if you have an existing *aptly* configuration since this may mess with it. diff --git a/linux-build-farm/aptly.sh b/linux-build-farm/aptly.sh new file mode 100755 index 000000000..8f96d3a04 --- /dev/null +++ b/linux-build-farm/aptly.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# This builds a series of Debian repositories for each distribution. + +export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin + +for distro in debian-* ubuntu-*; do + if [ -n "`find ${distro} -name '*.deb' -type f`" ]; then + arches=`ls ${distro}/*.deb | cut -d _ -f 3 | cut -d . -f 1 | xargs | sed 's/ /,/g'` + distro_name=`echo $distro | cut -d '-' -f 2` + echo '---' $distro / $distro_name / $arches + aptly repo create -architectures=${arches} -comment="ZeroTier, Inc. Debian Packages" -component="main" -distribution=${distro_name} zt-release-${distro} + aptly repo add zt-release-${distro} ${distro}/*.deb + aptly publish repo zt-release-${distro} ${distro_name} + fi +done