KA45EBF5GVBBFQ2E6GSMDJ5ORSOJ7YP5EHAHLUZB226F7WNO6KYQC
print $build, " ", $build->maintainers, "\n";
if ($build->resultInfo->buildstatus == 0) {
# Build succeeded. Only send mail if the previous build for
# the same platform failed.
return; # TODO
}
# Send mail.
# !!! should use the Template Toolkit here.
print STDERR "sending mail notification to ", $build->maintainers, "\n";
my $jobName = $build->project->name . ":" . $build->jobset->name . ":" . $build->job->name;
my $status =
$build->resultInfo->buildstatus == 0 ? "SUCCEEDED" : "FAILED";
my $sender = ($ENV{'USER'} || "hydra") . "@" . hostname_long . "\n";
return if !$build->maintainers;
my $selfURI = $ENV{'HYDRA_BASE_URI'} || "http://localhost:3000/";
my $body = "Hi,\n"
. "\n"
. "This is to let you know that Hydra build " . $build->id
. " of job " . $jobName . " has $status.\n"
. "\n"
. "The build information page can be found here: "
. "$selfURI/build/" . $build->id . "\n"
. "\n"
. "Regards,\n\nThe Hydra build daemon.\n";