summaryrefslogtreecommitdiffstats
path: root/mockit
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2024-04-19 11:47:03 +0200
committerRemi Collet <remi@php.net>2024-04-19 11:47:03 +0200
commit9fc98148d850b35f9e47e33188639424dfa89e48 (patch)
tree65cfd2424ef6ad21ef8ef51d55186d39cbd8e7f1 /mockit
parent1e7b3ee7cebffc20c1e9e14a97b3225d3315ac1e (diff)
add redis queue to mockit/mockrun
Diffstat (limited to 'mockit')
-rwxr-xr-xmockit31
1 files changed, 26 insertions, 5 deletions
diff --git a/mockit b/mockit
index 783500b..907e79c 100755
--- a/mockit
+++ b/mockit
@@ -7,6 +7,7 @@ fi
BUILD_BASE=1
BUILD_SCLS=1
+REDIS=0
if [ "$1" == "--nobase" -o "$1" == "--scl" ]; then
BUILD_BASE=0
@@ -16,6 +17,12 @@ if [ "$1" == "--noscl" -o "$1" == "--base" ]; then
BUILD_SCLS=0
shift
fi
+if [ "$1" == "--redis" ]; then
+ CHECK=$(redis-cli ping)
+ [ "$CHECK" = "PONG" ] || exit 1
+ REDIS=1
+ shift
+fi
SRPM=$1
DIST=$2
@@ -81,16 +88,30 @@ ID=${QUEUE:-$PPID}
[ $BUILD_BASE -ge 1 ] && for i in $LST
do
if [ 0$i -ge $MIN -a 0$i -le $MAX ]; then
- echo -n "$(date +%X) $i "
- mock -q --configdir=$mocketc --uniqueext=$ID -r ${DIST}${i} rebuild $SRPM "$@" && echo " Ok." || echo " Error !"
+ CMD="mock -q --configdir=$mocketc -r ${DIST}${i} rebuild $SRPM $@"
+ if [ $REDIS -ge 1 ]; then
+ redis-cli sadd mock "$CMD"
+ else
+ echo -n "$(date +%X) $i "
+ $CMD --uniqueext=$ID && echo " Ok." || echo " Error !"
+ fi
fi
done
[ $BUILD_SCLS -ge 1 ] && for i in $SCL
do
if [ 0$i -ge $MIN -a 0$i -le $MAX ]; then
- echo -n "$(date +%X) scl$i "
- mock -q --configdir=$mocketc --uniqueext=$ID -r ${DIST}scl${i} rebuild $SRPM "$@" && echo " Ok." || echo " Error !"
+ CMD="mock -q --configdir=$mocketc -r ${DIST}scl${i} rebuild $SRPM $@"
+ if [ $REDIS -ge 1 ]; then
+ redis-cli sadd mock "$CMD"
+ else
+ echo -n "$(date +%X) scl$i "
+ $CMD --uniqueext=$ID && echo " Ok." || echo " Error !"
+ fi
fi
done
-date +%X
+if [ $REDIS -ge 1 ]; then
+ echo "Queue size: " $(redis-cli scard mock)
+else
+ date +%X
+fi