[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 2 commits: djm: use getopt, with thanks to /usr/share/doc/util-linux/examples/getopt-parse.bash

Holger Levsen (@holger) gitlab at salsa.debian.org
Sun May 7 20:24:38 BST 2023



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


Commits:
a379d2ad by Holger Levsen at 2023-05-07T21:23:07+02:00
djm: use getopt, with thanks to /usr/share/doc/util-linux/examples/getopt-parse.bash

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

- - - - -
ef023510 by Roland Clobus at 2023-05-07T21:24:15+02:00
openQA: Longer timeouts and access to the developer mode

* Timeout increased to 1.8
* Developer mode needs FQDN, see https://open.qa/docs/#debugdevelmode

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

- - - - -


3 changed files:

- TODO
- bin/djm
- hosts/osuosl3-amd64/etc/openqa/workers.ini


Changes:

=====================================
TODO
=====================================
@@ -44,6 +44,7 @@ See link:https://jenkins.debian.net/userContent/about.html["about jenkins.debian
 ** document jenkins plugin updates -> manually / though my local script which calls the webpages can log this
 ** document other jenkins ui actions. are there any?
 * djm-logparser:
+** merge into djm --report and --show-month 04
 ** include hours with manual jobs triggered
 ** include notmuch mails, "received and read". write djm-notmuch-parser.
 ** include amount of job runs on jenkins


=====================================
bin/djm
=====================================
@@ -12,34 +12,60 @@ set -e
 set -o pipefail		# see eg http://petereisentraut.blogspot.com/2010/11/pipefail.html
 
 #
-# define environment and parse parameters
+# define environment
 #
-
+DRY_MODE=false
 LOGFILE=~/.djm.log
-if [ "$1" = "-d" ] || [ "$1" = "--dry-run" ] ; then
-	DRY_MODE=true
-	shift
-else
-	DRY_MODE=false
+FAIL_REASON=""
+CONFIRM=false
+
+#
+# parse parameters
+#
+
+# thanks to /usr/share/doc/util-linux/examples/getopt-parse.bash
+TEMP=$(getopt -o 'd' --long 'dry-run' -n 'djm' -- "$@")
+if [ $? -ne 0 ]; then
+	echo 'Terminating...' >&2
+	exit 1
 fi
+# Note the quotes around "$TEMP": they are essential!
+eval set -- "$TEMP"
+unset TEMP
+while true; do
+	case "$1" in
+		'-d'|'--dry-run')
+			echo 'Option a'
+			DRY_MODE=true
+			shift
+			continue
+		;;
+		'--')
+			shift
+			break
+		;;
+		*)
+			echo 'Internal error!' >&2
+			exit 1
+		;;
+	esac
+done
 
+#
+# make sure we have target, action & reason
+#
 TARGET=$1
 ACTION=$2
 REASON=$3
-FAIL_REASON=""
-CONFIRM=false
 
-if [ -z "$TARGET" ] ; then
-	FAIL_REASON="${FAIL_REASON}Undefined target.\n"
-else case $TARGET in
+case $TARGET in
 	.)	TARGET="."
 		;;
 	all)	TARGET="$(./nodes/list_nodes )"
 		;;
 	*)	TARGET="$(./nodes/list_nodes | egrep $TARGET || true)"
 		;;
-	esac
-fi
+esac
 
 if [ -z "$TARGET" ] ; then
 	FAIL_REASON="${FAIL_REASON}Undefined target.\n"
@@ -85,7 +111,7 @@ fi
 
 if [ -n "$FAIL_REASON" ] ; then
 	echo
-	echo problem parsing parameters, djm needs at least three:
+	echo problem parsing parameters, djm by default needs three:
 	echo "djm -d/--dry-run \$TARGET \$ACTION \$REASON"
 	echo
 	echo "TARGET=	'all' or grepable (jenkins, amd64, ionos, osuosl3) from ./nodes/list_nodes"


=====================================
hosts/osuosl3-amd64/etc/openqa/workers.ini
=====================================
@@ -24,7 +24,7 @@ CACHEWORKERS = 5
 # (required by the web UI's developer mode and backends using jump-hosts to
 #  reach back to os-autoinst; set if the automatically deduced value is not
 #  sufficient)
-#WORKER_HOSTNAME = openqa-worker.example.host
+WORKER_HOSTNAME = osuosl3-amd64.reproducible.osuosl.org
 
 # Optimize asset uploads. Enabled by default. When enabled the worker will
 # try to copy assets on the file system instead of uploading them to the
@@ -48,7 +48,7 @@ TERMINATE_AFTER_JOBS_DONE = 10
 PACKAGES_CMD = apt list --installed
 
 # This machine is under load, allow for longer timeouts
-TIMEOUT_SCALE = 1.5
+TIMEOUT_SCALE = 1.8
 
 # The section ids are the instance of the workers.
 # The key/value pairs will appear in vars.json



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/d5f600b340ec36e86fd159c208032922a25b9ebb...ef0235102795b7a481756eabddff5556ca0531c4

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/d5f600b340ec36e86fd159c208032922a25b9ebb...ef0235102795b7a481756eabddff5556ca0531c4
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/20230507/2e615db1/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list