[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] djm-logparser: make no fetch mode the default & make sure usernames are not capitalized

Holger Levsen (@holger) gitlab at salsa.debian.org
Thu May 4 13:19:09 BST 2023



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


Commits:
ed06e443 by Holger Levsen at 2023-05-04T14:18:42+02:00
djm-logparser: make no fetch mode the default & make sure usernames are not capitalized

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

- - - - -


2 changed files:

- TODO
- bin/djm-logparser


Changes:

=====================================
TODO
=====================================
@@ -32,6 +32,7 @@ See link:https://jenkins.debian.net/userContent/about.html["about jenkins.debian
 ** maybe: rm /tmp/mmdebstrap.* older than 3 days
 * split TODO in TODO and TODO.legacy?
 * djm:
+** also log an id, so that one command effecting several hosts is counted as on action
 ** ACTION: ff - fix future
 ** ACTION: c (or rc) - run command
 ** get rif of deploy_jdn
@@ -44,7 +45,6 @@ See link:https://jenkins.debian.net/userContent/about.html["about jenkins.debian
 ** document other jenkins ui actions. are there any?
 * djm-logparser:
 ** include hours with manual jobs triggered
-** make no fetch mode the default, -n --no-fetch
 ** include notmuch mails, "received and read". write djm-notmuch-parser.
 ** include amount of job runs on jenkins
 * djm-jenknis-parser:


=====================================
bin/djm-logparser
=====================================
@@ -16,7 +16,7 @@ set -o pipefail		# see eg http://petereisentraut.blogspot.com/2010/11/pipefail.h
 #
 if [ -z "$DJM_USER" ] ; then
 	if [ -n "$DEBFULLNAME" ] ; then
-		DJM_USER="$(echo $DEBFULLNAME | cut -d ' ' -f1)"
+		DJM_USER="$(echo $DEBFULLNAME | cut -d ' ' -f1 | tr '[:upper:]' '[:lower:]')"
 	else
 		echo "Environment variable DJM_USER must be set. Exiting."
 		exit 1
@@ -31,12 +31,15 @@ JOBS=~/.djm-jobs.txt
 #
 # parse jenkins build logs and copy the result over
 #
-if [ -z "$1" ] ; then
-	ssh $DJM_USER at jenkins.debian.net "DJM_USER=$DJM_USER /srv/jenkins/bin/djm-jenkins-parser"
-	scp $DJM_USER at jenkins.debian.net:$(basename $UI_LOGFILE) $UI_LOGFILE
-	scp $DJM_USER at jenkins.debian.net:$(basename $PARSER_LOGFILE) $PARSER_LOGFILE
-	ssh $DJM_USER at jenkins.debian.net "cd ~jenkins/jobs ; ls -1d reproducible_* |wc -l" > $JOBS
-fi
+case $1 in
+	-f|--fetch)
+		ssh $DJM_USER at jenkins.debian.net "DJM_USER=$DJM_USER /srv/jenkins/bin/djm-jenkins-parser"
+		scp $DJM_USER at jenkins.debian.net:$(basename $UI_LOGFILE) $UI_LOGFILE
+		scp $DJM_USER at jenkins.debian.net:$(basename $PARSER_LOGFILE) $PARSER_LOGFILE
+		ssh $DJM_USER at jenkins.debian.net "cd ~jenkins/jobs ; ls -1d reproducible_* |wc -l" > $JOBS
+		;;
+	*)	: ;;
+esac
 
 #
 # little helpers



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

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/ed06e44325f17fb708be0d19522f31043ab4afc1
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/20230504/66e7c2ca/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list