index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2019-09-18 13:38:00 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-09-18 13:40:08 +0200 |
commit | 492394371b39fa562304b45e809e9cb944ee12fa (patch) | |
tree | 4b6d7b81f3dff4ccf5662fc96f2ce48c34a46de3 | |
parent | 8424238d06afd0f3d7f011af1bcff68cf1912c67 (diff) |
-rwxr-xr-x | bin/nit-picker | 60 |
diff --git a/bin/nit-picker b/bin/nit-picker index 9395ef4..44a3e62 100755 --- a/bin/nit-picker +++ b/bin/nit-picker @@ -119,6 +119,12 @@ while pgrep -x ii >/dev/null \ printf ' WHERE `repositories`.`is_on_master_mirror`' printf ';\n' + printf 'SELECT' + printf ' "build-duration",' + printf '`build_slaves`.`name`' + printf ' FROM `build_slaves`' + printf ';\n' + printf 'SELECT DISTINCT' printf ' "binary-dependencies",' mysql_package_name_query @@ -332,6 +338,60 @@ while pgrep -x ii >/dev/null \ "${tmp_dir}/${parameters}" \ "${tmp_dir}/${parameters}.sig" ;; + 'build-duration') + infos=$( + # shellcheck disable=SC2016 + { + printf 'SELECT' + printf '`persons`.`name`,' + printf '`build_slaves`.`name`,' + printf '`architectures`.`name`,' + printf '`package_sources`.`pkgbase`,' + printf 'UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(' + printf 'MAX(' + printf 'IF(' + printf '`ssh_log`.`action`="get-assignment",' + printf '`ssh_log`.`date`,' + printf 'NULL' + printf ')' + printf ')' + printf ')' + printf ' FROM `build_slaves`' + mysql_join_build_slaves_build_assignments + mysql_join_build_assignments_architectures + mysql_join_build_assignments_package_sources + mysql_join_build_slaves_ssh_keys + mysql_join_ssh_keys_persons + mysql_join_build_slaves_ssh_log + printf ' WHERE `ssh_log`.`date`>=ADDDATE(NOW(),"-7 00:00:00")' + printf ' AND `build_slaves`.`name`=from_base64("%s")' \ + "$( + printf '%s' "${parameters}" \ + | base64 -w0 + )" + printf ' GROUP BY `build_slaves`.`id`' + printf ';\n' + } \ + | mysql_run_query \ + | tr '\t' ' ' + ) + if [ -z "${infos}" ]; then + continue + fi + if [ "${infos##* }" -lt $((60*60*24)) ]; then + continue + fi + printf '%s %s\n' \ + "${infos% *}" \ + "$( + date -d"@${infos##* }" +'%-j %H:%M:%S' + )" \ + | awk '{print $1 ": your slave " $2 " builds " $3 "/" $4 " for more than a day, now (" ($5-1) " day(s) " $6 ")"}' \ + | irc_say + if [ $# -eq 0 ]; then + sleep 60 + fi + ;; *) >&2 printf 'action "%s" is not yet implemented ...\n' "${action}" ;; |