forked from lix-project/hydra
Put build status in front of the notification mail subject
This commit is contained in:
parent
16dbec332d
commit
b8369a6a5f
|
@ -80,7 +80,7 @@ sub sendEmailNotification {
|
||||||
|
|
||||||
die unless $build->finished;
|
die unless $build->finished;
|
||||||
|
|
||||||
return if ! ( $build->jobset->enableemail && ($build->maintainers ne "" || $build->jobset->emailoverride ne "") );
|
return unless $build->jobset->enableemail && ($build->maintainers ne "" || $build->jobset->emailoverride ne "");
|
||||||
|
|
||||||
# Do we want to send mail?
|
# Do we want to send mail?
|
||||||
|
|
||||||
|
@ -96,14 +96,12 @@ sub sendEmailNotification {
|
||||||
}, { order_by => ["id DESC"] }
|
}, { order_by => ["id DESC"] }
|
||||||
);
|
);
|
||||||
|
|
||||||
# if build is cancelled or aborted, do not send email
|
# If build is cancelled or aborted, do not send email.
|
||||||
if ($build->buildstatus == 4 || $build->buildstatus == 3) {
|
return if $build->buildstatus == 4 || $build->buildstatus == 3;
|
||||||
return;
|
|
||||||
}
|
# If there is a previous (that is not cancelled or aborted) build
|
||||||
# if there is a previous (that is not cancelled or aborted) build with same buildstatus, do not send email
|
# with same buildstatus, do not send email.
|
||||||
if (defined $prevBuild && ($build->buildstatus == $prevBuild->buildstatus)) {
|
return if defined $prevBuild && ($build->buildstatus == $prevBuild->buildstatus);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Send mail.
|
# Send mail.
|
||||||
# !!! should use the Template Toolkit here.
|
# !!! should use the Template Toolkit here.
|
||||||
|
@ -112,7 +110,7 @@ sub sendEmailNotification {
|
||||||
|
|
||||||
my $jobName = $build->project->name . ":" . $build->jobset->name . ":" . $build->job->name;
|
my $jobName = $build->project->name . ":" . $build->jobset->name . ":" . $build->job->name;
|
||||||
|
|
||||||
my $status = statusDescription($build->buildstatus);
|
my $status = statusDescription($build->buildstatus);
|
||||||
|
|
||||||
my $baseurl = hostname_long;
|
my $baseurl = hostname_long;
|
||||||
my $sender = $config->{'notification_sender'} ||
|
my $sender = $config->{'notification_sender'} ||
|
||||||
|
@ -192,7 +190,7 @@ sub sendEmailNotification {
|
||||||
header => [
|
header => [
|
||||||
To => $to,
|
To => $to,
|
||||||
From => "Hydra Build Daemon <$sender>",
|
From => "Hydra Build Daemon <$sender>",
|
||||||
Subject => "Hydra job $jobName on " . $build->system . ", build " . $build->id . ": $status",
|
Subject => "$status: Hydra job $jobName on " . $build->system . ", build " . $build->id,
|
||||||
'X-Hydra-Instance' => $baseurl,
|
'X-Hydra-Instance' => $baseurl,
|
||||||
'X-Hydra-Project' => $build->project->name,
|
'X-Hydra-Project' => $build->project->name,
|
||||||
'X-Hydra-Jobset' => $build->jobset->name,
|
'X-Hydra-Jobset' => $build->jobset->name,
|
||||||
|
|
Loading…
Reference in a new issue