add a state file to help track what's building where
authorSteve McIntyre <steve@einval.com>
Wed, 24 Oct 2018 15:03:40 +0000 (15:03 +0000)
committerSteve McIntyre <steve@einval.com>
Wed, 24 Oct 2018 15:03:40 +0000 (15:03 +0000)
bin/build-client
bin/get_package
bin/report_build_result

index 029c613..da25a5a 100755 (executable)
@@ -140,7 +140,7 @@ while true; do
     rm ${LOGDIR}/${PKG_VER_ARCH}.log
     rsync -a /chroot/rebuildd/out-$PKG/ build@jack:out/
     rm -rf /chroot/rebuildd/out-$PKG
-    ssh build@jack ./bin/report_build_result "$HOSTNAME says $BNUM $PKG_VER_ARCH was $RESULT"
+    ssh build@jack ./bin/report_build_result $HOSTNAME $BNUM $PKG_VER_ARCH $RESULT
     BUILDS_DONE=$(($BUILDS_DONE + 1))
     if [ $MAX_BUILDS -gt 0 ] && [ $BUILDS_DONE -ge $MAX_BUILDS ]; then
        echo "Reached build limit of $MAX_BUILDS, stopping"
index 3444f56..29a4fc6 100755 (executable)
@@ -3,6 +3,7 @@
 CLIENT=$1
 LOGDIR=/home/build/logs
 LOGFILE=/var/log/builder.log
+STATEDIR=/home/build/state
 
 cd in
 
@@ -31,6 +32,7 @@ while true; do
 
     # else
     echo "$DATE: Queued package $NUM: $PKG_VER_ARCH on $CLIENT" >> $LOGFILE
+    echo "$DATE: Queued package $NUM: $PKG_VER_ARCH on $CLIENT" >> $STATEDIR/$NUM.running
     echo "$NUM $PKG_VER_ARCH"
     exit 0
 done
index 0ae4a85..96a3382 100755 (executable)
@@ -1,10 +1,17 @@
 #!/bin/bash
 
-MESSAGE="$@"
 LOGFILE=/var/log/builder.log
+STATEDIR=/home/build/state
+
+HOSTNAME=$1
+BNUM=$2
+PKG_VER_ARCH=$3
+RESULT=$4
 
 DATE=$(date)
-echo "$DATE: build result: $MESSAGE" >> $LOGFILE
+echo "$DATE: build result: $HOSTNAME says $BNUM $PKG_VER_ARCH was $RESULT" >> $LOGFILE
+
+rm $STATEDIR/$BNUM.running
 
 exit 0