[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] djm: improve help, plan future options

Holger Levsen (@holger) gitlab at salsa.debian.org
Fri Jun 9 11:39:55 BST 2023



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


Commits:
31439253 by Holger Levsen at 2023-06-09T12:39:35+02:00
djm: improve help, plan future options

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

- - - - -


2 changed files:

- TODO
- bin/djm


Changes:

=====================================
TODO
=====================================
@@ -48,21 +48,22 @@ 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:
-** option: -a/--action $1 $2 $3 and thus make djm_do a shortcut
-** option: -a/--annual-report as -y is taken too. hmmm.
+** option: -r -y => report for year X
+** option: -a/--action (default/implicit/optional), requiring $1 $2 $3 params...
+** option: -t/--today to be used with action shell (and maybe others)
+** option: --yolo/--dont-wait4-enter, default being wait for enter.
+** option: --no-fetch (--local? maybe)
+** make special TARGETs . and jenkins implicit for those actions requiring that target only (jenkins-ui, jenkins-restart, etc)
 ** action: rk / remove-oldest-kernel
 ** action: sm / shell-monitor
 ** action: rj / restart-jenkins
 ** action: mo / mark-offline
 ** action: so / show-offline
 ** action: ao / all-online / mark all online
-** action: s|top-builds: 1st stop build service, 2nd stop builds on all nodes
+** action: sb|top-builds: 1st stop build service, 2nd stop builds on all nodes
 *** only on jenkins
 *** as root: service reproducible_build at startup stop
 *** as jenkins: /srv/jenkins/bin/reproducible_cleanup_nodes.sh (twice)
-** option: --today to be used with action shell (and maybe others)
-** option: --dont-wait4-enter, default being wait for enter.
-** option: --no-fetch
 ** write documentation for djm
 ** also log an id, so that one command effecting several hosts is counted as on action
 *** make actions triggering 'all' be only one entry in the djm logfile -> more sensible stats


=====================================
bin/djm
=====================================
@@ -157,20 +157,20 @@ show_help(){
 	seperator "="
 	echo
 	echo "djm				shows report (and sometimes fetches remote data)"
-	echo "djm -h/--help			shows this help"
 	echo "djm -d/--dry-run *		will not actually do *"
 	echo "djm -f/--fetch (*)		force fetching remote data (and optionally do *)"
+	echo "djm -h/--help			shows this help"
+	echo "djm -m/--month MONTH		define MONTH for showing report"
+	echo "djm -n/--no-future *		do *, and then keep 'future hosts' running in the present"
 	echo "djm -r/--report			shows report (and sometimes fetches remote data)"
 	echo "djm -v/--verbose *		do * verbosely"
-	echo "djm -m/--month MONTH		define MONTH for showing report"
 	echo "djm -y/--year YEAR		define YEAR for showing report"
-	echo "djm -n/--no-future *		do *, and then keep 'future hosts' running in the present"
-	echo "djm TARGET ACTION REASON		do ACTION on all TARGET(s) for REASON, see below: "
+	echo "djm TARGET ACTION REASON	do ACTION on all TARGET(s) for REASON, see below:"
 	echo
-	echo "TARGET=	'all' or grepable (jenkins, amd64, ionos, osuosl3) from ./nodes/list_nodes"
-	echo "         	or special target '.' for jenkins-ui ACTION."
+	echo "TARGET= 'all' or grepable (jenkins, amd64, ionos, osuosl3) from ./nodes/list_nodes"
+	echo "        or special target '.' for jenkins-ui ACTION."
 	echo
-	echo "ACTION=   one of these:"
+	echo "ACTION= one of these:"
 	echo "         a|autoremove            apt autoremove && apt clean"
 	echo "         b|bring-back            mark hosts as online"
 	echo "         c|command               run \$4 on hosts"
@@ -183,7 +183,7 @@ show_help(){
 	echo "         s|shell                 for manual maintenance"
 	echo "         u|upgrade               apt update && apt -y dist-upgrade"
 	echo
-	echo "REASON=   one of these:"
+	echo "REASON= one of these:"
 	echo "          cs=clock skew"
 	echo "          dj=debug job problems"
 	echo "          dh=debug host problems"
@@ -198,14 +198,13 @@ show_help(){
 	if [ -n "$1" ] ; then
 		seperator
 		echo
-		echo problem parsing given parameters:
-		echo
-		echo "\$1 = $1"
-		echo "\$2 = $2"
-		echo "\$3 = $3"
+		echo Problem parsing parameters:
+		echo "TARGET = $1"
+		echo "ACTION = $2"
+		echo "REASON = $3"
 		# FIXME: $4 is not explained here
 		echo
-		echo parsing problems:
+		echo Problems encountered:
 		echo
 		echo -e "$4"
 		echo
@@ -228,7 +227,7 @@ verify_target_action_reason(){
 			;;
 	esac
 	if [ -z "$TARGET" ] ; then
-		FAIL_REASON="${FAIL_REASON}Undefined target.\n"
+		FAIL_REASON="${FAIL_REASON}Unknown target.\n"
 	fi
 	case $ACTION in
 		a|autoremove)	ACTION=autoremove				;;
@@ -242,7 +241,7 @@ verify_target_action_reason(){
 		rm|rmstamp)	ACTION=rmstamp					;;
 		s|shell)	ACTION=shell					;;
 		u|upgrade)	ACTION=apt-upgrade				;;
-		*)		FAIL_REASON="${FAIL_REASON}Undefined action.\n" ;;
+		*)		FAIL_REASON="${FAIL_REASON}Unknown action.\n" ;;
 	esac
 	case $REASON in
 		cs)	REASON="clock skew"				;;
@@ -255,7 +254,7 @@ verify_target_action_reason(){
 		nt)	REASON="new things"				;;
 		rm)	REASON="regular maintenance"			;;
 		su)	REASON="security updates"			;;
-		*)	FAIL_REASON="${FAIL_REASON}Undefined reason.\n" ;;
+		*)	FAIL_REASON="${FAIL_REASON}Unknown reason.\n" ;;
 	esac
 	#
 	# some targets only allow specific actions
@@ -269,7 +268,7 @@ verify_target_action_reason(){
 
 djm_header() {
 	echo "djm = documented jenkins maintenance"
-	echo "      jenkins.debian.net exists since 2012, djm since 2023-04."
+	echo "      jenkins.debian.net exists since 2012, djm since 2023-04,"
 	echo "      so expect changes for some time."
 }
 



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

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/314392530ad18a654815d169b48b9deae12f1f31
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/20230609/5b0daffb/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list