* Send email if a build fails.
[?]
Jul 8, 2009, 3:52 PM
KA45EBF5GVBBFQ2E6GSMDJ5ORSOJ7YP5EHAHLUZB226F7WNO6KYQCDependencies
- [2]
OG7BEM57 - [3]
FHF6IZJQ* Basic release management: releases are now dynamically computed as - [4]
7YBYT2LQ - [5]
TULPZ62Y* Perform builds in parallel. - [6]
L2E6EVE2* Merged the Build and Job tables. - [7]
CLJQCY2X* Store info about all the build actions and allow them to be - [8]
3BKF6P72* Use Nix's negative caching. - [9]
AFTXA575* $HYDRA_DATA environment variable. - [*]
RWIBJ5L4* Autoflush stdout.
Change contents
- edit in src/script/hydra_build.pl at line 12[2.399][11.0]
use Sys::Hostname::Long; - edit in src/script/hydra_build.pl at line 29
die unless defined $build->resultInfo;return if !$build->maintainers;# Do we want to send mail? - replacement in src/script/hydra_build.pl at line 36
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"; - replacement in src/script/hydra_build.pl at line 55
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"; - replacement in src/script/hydra_build.pl at line 70
From => "Hydra <e.dolstra\@tudelft.nl>",Subject => "Build " . $build->id . " finished",From => "Hydra Build Daemon <$sender>",Subject => "Hydra job $jobName build " . $build->id . " $status", - replacement in src/script/hydra_build.pl at line 73
body => "Build finished!\n",body => $body, - replacement in src/script/hydra_build.pl at line 76
print $email->as_string;print $email->as_string if $ENV{'HYDRA_MAIL_TEST'}; - replacement in src/script/hydra_build.pl at line 320
#sendEmailNotification $build;sendEmailNotification $build; - replacement in src/script/hydra_build.pl at line 327
#sendEmailNotification $db->resultset('Builds')->find($buildId);#exit 0;if ($ENV{'HYDRA_MAIL_TEST'}) {sendEmailNotification $db->resultset('Builds')->find($buildId);exit 0;}