[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] jenkins shell monitor: colorize offline nodes

Holger Levsen (@holger) gitlab at salsa.debian.org
Sun Jan 16 01:04:44 GMT 2022



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


Commits:
f13ca601 by Holger Levsen at 2022-01-16T02:04:30+01:00
jenkins shell monitor: colorize offline nodes

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

- - - - -


1 changed file:

- bin/jenkins-shell-monitor.sh


Changes:

=====================================
bin/jenkins-shell-monitor.sh
=====================================
@@ -110,12 +110,13 @@ main_loop() {
 		echo "=== jenkins/trbo shell monitor ==="
 		echo
 		echo "relevant lines from ~jenkins/offline_nodes:"
-		grep -A 2342 Also ~jenkins/offline_nodes | tac | sed -e '/# none atm/,+1d' | tac | sed '/^$/d'
+		grep -A 2342 Also ~jenkins/offline_nodes | sed '/^$/d' | sed  "/^#/! s/^/$YELLOW/g" | sed  "/^#/! s/$/$FOREGROUND_COLOR/g" | grep -v "nvestigation needed" | grep -v "Down here nodes" | grep -v "failing their health check"
 		# ^^^ this line explained:
 		# we grep for everything after the string 'Also" because we know the document and this will never change... m( :)
-		# tac is reverse cat. so doing it twice allows us to use sed backwards
-		# the first sed removes the matching line and the following (which due to tac is the previous one)
-		# the second sed command removes empty lines
+		# the first sed command removes empty lines
+		# the second sed command replaces the beginning of non-matching lines with $YELLOW
+		# the third sed puts back the original foreground color..
+		# and then we filter out some lines.
 		echo
 		figlet $(cat ~/userContent/reproducible/trbo.status) 
 		echo " ^^^ trbo status, see https://tests.reproducible-builds.org/trbo.status.html"



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

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/f13ca601a69ffa61edb501a50e245c888c3323d3
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/20220116/4063de22/attachment.htm>


More information about the Qa-jenkins-scm mailing list