Browse Source

aptly script

Adam Ierymenko 9 years ago
parent
commit
751497a748
2 changed files with 18 additions and 0 deletions
  1. 2 0
      linux-build-farm/README.md
  2. 16 0
      linux-build-farm/aptly.sh

+ 2 - 0
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.
 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.
 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.

+ 16 - 0
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