[Qa-jenkins-scm] [jenkins.debian.net] 02/04: reproducible Debian: only start workers if they are not running already
Holger Levsen
holger at layer-acht.org
Thu Apr 27 10:44:59 UTC 2017
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository jenkins.debian.net.
commit d6f77dd26289c8e5770b1832c8830dafed5171e2
Author: Holger Levsen <holger at layer-acht.org>
Date: Thu Apr 27 12:30:23 2017 +0200
reproducible Debian: only start workers if they are not running already
Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
bin/reproducible_build_service.sh | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/bin/reproducible_build_service.sh b/bin/reproducible_build_service.sh
index 04ee0e3..0c1c3e4 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
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git
More information about the Qa-jenkins-scm
mailing list