[Qa-jenkins-scm] [jenkins.debian.net] 02/03: reproducible debian: Add a mean to very gracefully stop the rb workers

Mattia Rizzolo mattia at debian.org
Wed Apr 4 09:39:37 UTC 2018


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository jenkins.debian.net.

commit 1fb3417e11f7f7c0a6749146393799a4ac6fd86c
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Wed Apr 4 10:43:52 2018 +0200

    reproducible debian: Add a mean to very gracefully stop the rb workers
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 bin/reproducible_worker.sh                                   | 7 +++++++
 hosts/jenkins/etc/systemd/system/reproducible_build at .service | 1 +
 2 files changed, 8 insertions(+)

diff --git a/bin/reproducible_worker.sh b/bin/reproducible_worker.sh
index 99b597a..43f2c96 100755
--- a/bin/reproducible_worker.sh
+++ b/bin/reproducible_worker.sh
@@ -1,6 +1,8 @@
 #!/bin/bash
+# vim: set noexpandtab:
 
 # Copyright © 2017 Holger Levsen (holger at layer-acht.org)
+#           © 2018 Mattia Rizolo <mattia at debian.org>
 # released under the GPLv=2
 
 set -e
@@ -41,6 +43,11 @@ while true ; do
 			break
 		fi
 	fi
+	LOCKFILE="/var/lib/jenkins/NO-RB-BUILDERS-PLEASE"
+	if [ -f "$LOCKFILE" ];
+		echo "The lockfile $LOCKFILE is present, thus stopping this"
+		break
+	fi
 
 	# sleep up to 2.3 seconds (additionally to the random sleep reproducible_build.sh does anyway)
 	/bin/sleep $(echo "scale=1 ; $(shuf -i 1-23 -n 1)/10" | bc )
diff --git a/hosts/jenkins/etc/systemd/system/reproducible_build at .service b/hosts/jenkins/etc/systemd/system/reproducible_build at .service
index 96228f1..c626fe2 100644
--- a/hosts/jenkins/etc/systemd/system/reproducible_build at .service
+++ b/hosts/jenkins/etc/systemd/system/reproducible_build at .service
@@ -1,5 +1,6 @@
 [Unit]
 Description=Build service for reproducible-builds jobs
+ConditionPathExists=!/var/lib/jenkins/NO-RB-BUILDERS-PLEASE
 
 [Service]
 # Restart whenever the script exits, without rate limiting:

-- 
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