From d12dd0f9631357ac568bb2163dc7a292688e3f10 Mon Sep 17 00:00:00 2001 From: Kirill Miazine Date: Fri, 8 Dec 2023 15:22:32 +0000 Subject: [PATCH] push notifications to IRC #exim-builds --- cgi-bin/eximstatus.pl | 24 ++++++++++++++++++++++++ cgi-bin/register.pl | 13 +++++++++++++ 2 files changed, 37 insertions(+) diff --git a/cgi-bin/eximstatus.pl b/cgi-bin/eximstatus.pl index 33b6d24..0184ae8 100755 --- a/cgi-bin/eximstatus.pl +++ b/cgi-bin/eximstatus.pl @@ -568,6 +568,19 @@ EOMAIL $fh->close; +use HTTP::Tiny; +use JSON::PP; +HTTP::Tiny->new(timeout => 5)->post( + 'http://127.0.0.1:2567/api/message', { + headers => {'content-type' => 'application/json'}, + content => encode_json({ + gateway => 'exim-builds', + username => '', + text => "$animal [$branch]: @{[lc $stat_type]}: @{[lc $stage]}; commit: https://git.exim.org/@{[substr $githeadref, 0, 10]}", + }), + } +); + exit if ($stage eq $prev_stat); $mailto = [@$change_stat]; @@ -605,3 +618,14 @@ For more information, see $url/cgi-bin/show_history.pl?nm=$animal&br=$branch EOMAIL $fh->close; + +HTTP::Tiny->new(timeout => 5)->post( + 'http://127.0.0.1:2567/api/message', { + headers => {'content-type' => 'application/json'}, + content => encode_json({ + gateway => 'exim-builds', + username => '', + text => "$animal [$branch]: status @{[lc $stat_type]}; $url/cgi-bin/show_history.pl?nm=$animal&br=$branch", + }), + } +); diff --git a/cgi-bin/register.pl b/cgi-bin/register.pl index 80663b6..808cd89 100755 --- a/cgi-bin/register.pl +++ b/cgi-bin/register.pl @@ -158,3 +158,16 @@ print $fh "\n\nName: $dummyname\n", "Comp: $comp: $compv\n", "Owner: $owner <$email>\n"; $fh->close; + +use HTTP::Tiny; +use JSON::PP; +HTTP::Tiny->new(timeout => 5)->post( + 'http://127.0.0.1:2567/api/message', { + headers => {'content-type' => 'application/json'}, + content => encode_json({ + gateway => 'exim-builds', + username => '', + text => "[new application] os: $os ($osv); arch: $arch; comp: $comp ($compv)", + }), + } +); -- 2.30.2