This repository has been archived on 2023-01-08. You can view files and clone it, but cannot push or open issues or pull requests.
ptrcports/ptrc-build/build

39 lines
721 B
Text
Raw Normal View History

2022-04-27 23:32:43 +00:00
#!/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"
. /etc/ptrc-build.conf
2022-04-27 23:32:43 +00:00
arch=$(apk --print-arch)
pub() {
mosquitto_pub -h mqtt.torastian.com \
-u build \
-p 8883 \
-P "$MQTT_BUILD_PASSWORD" \
-t build/$arch \
--tls-version tlsv1.3 \
-m "$1"
2022-04-27 23:32:43 +00:00
}
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"