[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 2 commits: djm: improve output when skipping nodes not running in the future

Holger Levsen (@holger) gitlab at salsa.debian.org
Tue May 16 17:04:42 BST 2023



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


Commits:
37d81437 by Holger Levsen at 2023-05-16T17:50:21+02:00
djm: improve output when skipping nodes not running in the future

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

- - - - -
f44dd74b by Holger Levsen at 2023-05-16T18:02:28+02:00
djm: new action: rmstamp

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

- - - - -


2 changed files:

- TODO
- bin/djm


Changes:

=====================================
TODO
=====================================
@@ -32,7 +32,6 @@ 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:
-** ACTION: rm|stamp
 ** ACTION: c|command - run arbitrary command (with and without reset_clock)
 ** then get rid of deploy_jdn
 ** also log an id, so that one command effecting several hosts is counted as on action


=====================================
bin/djm
=====================================
@@ -136,6 +136,7 @@ show_help(){
 	echo "         _j_enkins-ui             for when doing things manually in the jenkins-ui"
 	echo "         _p_owercycle"
 	echo "         _r_eboot"
+	echo "         _rm_stamp                remove stamp files (from pbuilder and update_jdn.sh)"
 	echo "         _s_shell                 for manual maintenance"
 	echo "         _u_pgrade                apt update && apt -y dist-upgrade"
 	echo
@@ -190,8 +191,9 @@ verify_target_action_reason(){
 		d|deploy-git)	ACTION=deploy-git				;;
 		f|fix-future)	ACTION=fix-future				;;
 		j|jenkins-ui)	ACTION=jenkins-ui				;;
-		p|powercycle)	ACTION=powercycle 	;	CONFIRM=true	;;
-		r|reboot)	ACTION=reboot 		;	CONFIRM=true	;;
+		p|powercycle)	ACTION=powercycle	;	CONFIRM=true	;;
+		r|reboot)	ACTION=reboot		;	CONFIRM=true	;;
+		rm|rmstamp)	ACTION=rmstamp					;;
 		s|shell)	ACTION=shell					;;
 		u|upgrade)	ACTION=apt-upgrade				;;
 		*)		FAIL_REASON="${FAIL_REASON}Undefined action.\n" ;;
@@ -451,7 +453,6 @@ djm_do() {
 		else
 			SHORTNODE="jenkins web UI"
 		fi
-		echo "$(date -u '+%Y-%m-%d %H:%M UTC'), $SHORTNODE, $ACTION, $REASON"
 		# node specific configuration
 		get_arch_color $NODE
 		case $SHORTNODE in
@@ -506,7 +507,7 @@ djm_do() {
 						COMMAND="$COMMAND ; date -u ; echo press enter ; read a"
 						xterm -T "$SHORTNODE / $ACTION" -class deploy-jenkins -bg $BG -fa 'DejaVuSansMono' -fs 10 -e "ssh $NODE \"$COMMAND\"" &
 					else
-						echo "Skipping $SHORTNODE as it's not running in the future."
+						echo " - skipping $SHORTNODE, not running in the future."
 						continue
 					fi
 
@@ -547,6 +548,9 @@ djm_do() {
 					COMMAND="( $COMMAND ) || ( echo press enter ; read a ) ; echo 'sleeping 10s now' ; sleep 10"
 					xterm -T "$SHORTNODE / $ACTION" -class deploy-jenkins -bg $BG -fa 'DejaVuSansMono' -fs 10 -e "ssh -t $NODE \"$COMMAND\"" &
 					;;
+			rmstamp)	COMMAND="sudo rm -f /var/log/jenkins/*stamp"
+					xterm -T "$SHORTNODE / $ACTION" -class deploy-jenkins -bg $BG -fa 'DejaVuSansMono' -fs 10 -e "ssh -t $NODE \"$COMMAND\"" &
+					;;
 			*)	echo unsupported action, sorry, please improve.
 				exit 1
 				;;
@@ -555,7 +559,7 @@ djm_do() {
 		#
 		# log
 		#
-		echo "$LOGDATE, $SHORTNODE, $ACTION, $REASON" >> $LOGFILE
+		echo "$LOGDATE, $SHORTNODE, $ACTION, $REASON" | tee -a $LOGFILE
 	done
 	
 	echo Thank you for doing documented jenkins maintenance.



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/0ce2cc88743b083fbe58537b859e435dee51a8e0...f44dd74b98bf4b700bdf80da8eea792773485381

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/0ce2cc88743b083fbe58537b859e435dee51a8e0...f44dd74b98bf4b700bdf80da8eea792773485381
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/20230516/7383349f/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list