From 312094ef1291d5eb4fec9eaa891dc495f3e1f455 Mon Sep 17 00:00:00 2001 From: psykose Date: Wed, 27 Apr 2022 23:32:43 +0000 Subject: [PATCH] ptrc-build: new ptrcport --- ptrc-build/APKBUILD | 19 +++++++++++++++++++ ptrc-build/build | 30 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 ptrc-build/APKBUILD create mode 100644 ptrc-build/build diff --git a/ptrc-build/APKBUILD b/ptrc-build/APKBUILD new file mode 100644 index 0000000..d225f3c --- /dev/null +++ b/ptrc-build/APKBUILD @@ -0,0 +1,19 @@ +# Maintainer: Patrycja Rosa +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 +" diff --git a/ptrc-build/build b/ptrc-build/build new file mode 100644 index 0000000..01d73fa --- /dev/null +++ b/ptrc-build/build @@ -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"