push notifications to IRC #exim-builds
authorKirill Miazine <km@krot.org>
Fri, 8 Dec 2023 15:22:32 +0000 (15:22 +0000)
committerJeremy Harris <jgh@exim.org>
Fri, 8 Dec 2023 15:22:51 +0000 (15:22 +0000)
cgi-bin/eximstatus.pl
cgi-bin/register.pl

index 33b6d2408788e8110284b205408a623a81aa1ab3..0184ae854f77adcb81298b2043d433b6357d1116 100755 (executable)
@@ -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",
+        }),
+    }
+);
index 80663b67aefb6ad09f9751bf7950ff38b2ce718a..808cd8938af5f379b6dbc0770c6a0c9f68a55bf3 100755 (executable)
@@ -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)",
+        }),
+    }
+);