From: Kirill Miazine Date: Fri, 8 Dec 2023 15:22:32 +0000 (+0000) Subject: push notifications to IRC #exim-builds X-Git-Url: https://git.exim.org/buildfarm-server.git/commitdiff_plain/d12dd0f9631357ac568bb2163dc7a292688e3f10?hp=a89b122ebd89a3d16913dbd7a5a56649e58a25d0 push notifications to IRC #exim-builds --- 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)", + }), + } +);