summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_build_service.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2017-04-27 12:30:23 +0200
committerHolger Levsen <holger@layer-acht.org>2017-04-27 12:30:23 +0200
commitd6f77dd26289c8e5770b1832c8830dafed5171e2 (patch)
treec8e1effc7f605de65ce7e5f162481a6aa117886c /bin/reproducible_build_service.sh
parent87d434c263fd3532b3df636572da9ab2919f276a (diff)
downloadjenkins.debian.net-d6f77dd26289c8e5770b1832c8830dafed5171e2.tar.xz
reproducible Debian: only start workers if they are not running already
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_build_service.sh')
-rwxr-xr-xbin/reproducible_build_service.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/reproducible_build_service.sh b/bin/reproducible_build_service.sh
index 04ee0e33..0c1c3e4c 100755
--- a/bin/reproducible_build_service.sh
+++ b/bin/reproducible_build_service.sh
@@ -202,11 +202,19 @@ startup_workers() {
/bin/sleep $(echo "scale=1 ; $(shuf -i 1-23 -n 1)/10" | bc )
WORKER_NAME=${ARCH}_$i
+
+ WORKER_BIN=/srv/jenkins/bin/reproducible_worker.sh
+ RUNNING=$(ps fax|grep -v grep|grep "$WORKER_BIN $WORKER_NAME")
+ if [ -z "$RUNNING" ] ; then
+ echo "$(date --utc) - '$(basename $WORKER_BIN) $WORKER_NAME' already running, thus moving on to the next."
+ continue
+ fi
+
choose_node $WORKER_NAME
BUILD_BASE=/var/lib/jenkins/userContent/reproducible/debian/build_service/$WORKER_NAME
mkdir -p $BUILD_BASE
echo "$(date --utc) - Starting $WORKER_NAME"
- /srv/jenkins/bin/reproducible_worker.sh $WORKER_NAME $NODE1 $NODE2 >$BUILD_BASE/worker.log 2>&1 &
+ $WORKER_BIN $WORKER_NAME $NODE1 $NODE2 >$BUILD_BASE/worker.log 2>&1 &
done
done
}