[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible: refactoring

Holger Levsen gitlab at salsa.debian.org
Sat Jun 13 08:37:45 BST 2020



Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
42836763 by Holger Levsen at 2020-06-13T09:37:28+02:00
reproducible: refactoring

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


4 changed files:

- bin/reproducible_build.sh
- bin/reproducible_common.sh
- bin/reproducible_html_nodes_info.sh
- bin/reproducible_maintenance.sh


Changes:

=====================================
bin/reproducible_build.sh
=====================================
@@ -1,7 +1,7 @@
 #!/bin/bash
 # vim: set noexpandtab:
 
-# Copyright 2014-2019 Holger Levsen <holger at layer-acht.org>
+# Copyright 2014-2020 Holger Levsen <holger at layer-acht.org>
 #         © 2015-2018 Mattia Rizzolo <mattia at debian.org>
 # released under the GPLv2
 
@@ -757,14 +757,14 @@ EOF
 
 check_node_is_up() {
 	# this actually tests three things:
-	# - the node is not listed in ~/offline_nodes
+	# - the node is not listed in $JENKINS_OFFLINE_LIST=
 	# - ssh login works
 	# - /tmp is not mounted in read-only mode
 	local NODE=$1
 	local SLEEPTIME=$2
 	set +e
-	echo "$(date -u) - checking ~/offline_nodes if $NODE is marked as down."
-	if grep -q $NODE ~/offline_nodes >/dev/null 2>&1 ; then
+	echo "$(date -u) - checking $JENKINS_OFFLINE_LIST if $NODE is marked as down."
+	if grep -q $NODE $JENKINS_OFFLINE_LIST >/dev/null 2>&1 ; then
 		echo "$(date -u) - $NODE seems to marked as down, sleeping ${SLEEPTIME}min before aborting this job."
 		unregister_build
 		sleep ${SLEEPTIME}.1337m


=====================================
bin/reproducible_common.sh
=====================================
@@ -42,6 +42,7 @@ ARCHS="amd64 i386 arm64 armhf"
 . /srv/jenkins/bin/jenkins_node_definitions.sh
 MAINNODE="jenkins" # used by reproducible_maintenance.sh only
 JENKINS_OFFLINE_LIST="/var/lib/jenkins/offline_nodes"
+JENKINS_OFFLINE_GIT_LIST="/home/jenkins-adm/jenkins.debian.net/jenkins-home/offline_nodes"
 
 # variables on the nodes we are interested in
 BUILD_ENV_VARS="ARCH NUM_CPU CPU_MODEL DATETIME KERNEL" # these also needs to be defined in bin/reproducible_info.sh


=====================================
bin/reproducible_html_nodes_info.sh
=====================================
@@ -105,7 +105,6 @@ build_nodes_health_page() {
 			BADGE="$URL/badge/icon"
 			write_page "<td><a href='$URL'><img src='$BADGE' /></a></td>"
 			# mark offline nodes
-			JENKINS_OFFLINE_GIT_LIST=~jenkins-adm/jenkins.debian.net/jenkins-home/offline_nodes
 			if [ -f "$JENKINS_OFFLINE_GIT_LIST" ] && ! grep -q "$NODE" "$JENKINS_OFFLINE_GIT_LIST" \
 			 && ( [ -f "$JENKINS_OFFLINE_LIST" ] && grep -q "$NODE" "$JENKINS_OFFLINE_LIST" ) ; then
 				write_page '</td><td colspan="9" style="text-align: center;"><span style="font-style: italic;">temporarily marked offline by jenkins</span></td>'


=====================================
bin/reproducible_maintenance.sh
=====================================
@@ -219,10 +219,10 @@ if [ "$HOSTNAME" = "$MAINNODE" ] ; then
 		# or the last successful run is older than an hour (=a job is still running/hanging)
 		elif [ $DIFF -gt $MAXDIFF ] || [ $LAST -ot $DUMMY_FILE ] ; then
 			echo -n "$i job has issues since more than an hour"
-			if grep -q $NODE ~/offline_nodes >/dev/null 2>&1 ; then
+			if grep -q $NODE $JENKINS_OFFLINE_LIST >/dev/null 2>&1 ; then
 				echo " and $NODE already marked as offline, good."
 			else
-				echo $NODE >> ~/offline_nodes
+				echo $NODE >> $JENKINS_OFFLINE_LIST
 				echo " so $NODE has (temporarily) been marked as offline now."
 				SICK="$SICK $NODE"
 			fi



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/42836763ebdffc11372a4f792de3969d62be8121

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/42836763ebdffc11372a4f792de3969d62be8121
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20200613/9ed69326/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list