ptrc-build: new ptrcport

This commit is contained in:
psykose 2022-04-27 23:32:43 +00:00
parent 4383c8b134
commit 312094ef12
Signed by: psykose
SSH key fingerprint: SHA256:HwlGVJNLZqHoOvMtkshyGaXLkcdbEJahYMlepHFL+Uk
2 changed files with 49 additions and 0 deletions

19
ptrc-build/APKBUILD Normal file
View file

@ -0,0 +1,19 @@
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=ptrc-build
pkgver=1
pkgrel=0
pkgdesc="build invoker for ptrcports"
url="https://git.ddd.rip/ptrcnull/ptrcports"
arch="noarch"
license="BSD-2-Clause"
depends="lua-aports mosquitto-clients"
source="build"
options="!check" # lol
package() {
install -Dm755 build -t "$pkgdir"/usr/bin
}
sha512sums="
d7fe36a964cd11123117dc6ee1fa1d644ae563de6709d865890893ea15c4a5d51d8bd01c71a051f1759f9396697aa38ad844bfd8e8ca8abd81bec17cd3c4006a build
"

30
ptrc-build/build Normal file
View file

@ -0,0 +1,30 @@
#!/bin/sh
# workaround for /sbin being missing sometimes, which causes all abuild operations
# to fail silently since apk is not in path
export PATH="/usr/bin:/usr/sbin:/bin:/sbin"
arch=$(apk --print-arch)
pub() {
mosquitto_pub -L mqtts://build:build@mqtt.torastian.com/build/$arch -m "$1"
}
echo "pulling git"
pub "pulling git"
cd "$HOME/ptrcports"
git fetch --all
git reset --hard origin/master
nice -n 10 buildrepo \
-a "$HOME" \
-d /var/www/repo.ptrc.pl \
-l "$HOME/logs" \
-p ptrcports | while read -r line; do
echo "$line"
echo "$line" | grep -q 'ptrcports/' && pub "$line"
done
echo "idle"
pub "idle"