[Qa-jenkins-scm] [jenkins.debian.net] 01/04: reproducible Debian: refactor

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 87d434c263fd3532b3df636572da9ab2919f276a
Author: Holger Levsen <holger at layer-acht.org>
Date:   Thu Apr 27 12:24:36 2017 +0200

    reproducible Debian: refactor
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_build_service.sh | 48 +++++++++++++++++++++++----------------
 1 file changed, 28 insertions(+), 20 deletions(-)

diff --git a/bin/reproducible_build_service.sh b/bin/reproducible_build_service.sh
index 657ff74..04ee0e3 100755
--- a/bin/reproducible_build_service.sh
+++ b/bin/reproducible_build_service.sh
@@ -5,6 +5,10 @@
 
 set -e
 
+# those should be global variables
+NODE1=""
+NODE2=""
+
 choose_node() {
 	case $1 in
 		amd64_1)	NODE1=profitbricks-build1-amd64		NODE2=profitbricks-build5-amd64 ;;
@@ -184,29 +188,33 @@ choose_node() {
 	esac
 }
 
-NODE1=""
-NODE2=""
-for ARCH in amd64 i386 arm64 armhf ; do
-	case $ARCH in
-		amd64)	MAX=40 ;;
-		i386)	MAX=24 ;;
-		arm64)	MAX=32 ;;
-		armhf)	MAX=66 ;;
-		*)	;;
-	esac
-	for i in $(seq 1 $MAX) ; do
-	        # 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 )
+startup_workers() {
+	for ARCH in amd64 i386 arm64 armhf ; do
+		case $ARCH in
+			amd64)	MAX=40 ;;
+			i386)	MAX=24 ;;
+			arm64)	MAX=32 ;;
+			armhf)	MAX=66 ;;
+			*)	;;
+		esac
+		for i in $(seq 1 $MAX) ; do
+		        # 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 )
 
-		WORKER_NAME=${ARCH}_$i
-		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_NAME=${ARCH}_$i
+			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 &
+		done
 	done
-done
+}
 
+#
+# main
+#
+startup_workers
 # keep running forever…
 while true ; do sleep 1337m ; 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