Omit the system type if it's part of the job name

This commit is contained in:
Eelco Dolstra 2013-05-15 11:43:06 +02:00
parent ac6a152ec5
commit 444b03bad2

View file

@ -55,7 +55,7 @@ sub getPrevBuild {
my $template = <<EOF; my $template = <<EOF;
Hi, Hi,
The status of Hydra job [% showJobName(build) %] (on [% build.system %]) [% IF prevBuild && build.buildstatus != prevBuild.buildstatus %]has changed from "[% showStatus(prevBuild) %]" to "[% showStatus(build) %]"[% ELSE %]is "[% showStatus(build) %]"[% END %]. For details, see The status of Hydra job [% showJobName(build) %] [% IF showSystem %](on [% build.system %]) [% END %][% IF prevBuild && build.buildstatus != prevBuild.buildstatus %]has changed from "[% showStatus(prevBuild) %]" to "[% showStatus(build) %]"[% ELSE %]is "[% showStatus(build) %]"[% END %]. For details, see
[% baseurl %]/build/[% build.id %] [% baseurl %]/build/[% build.id %]
@ -126,6 +126,7 @@ sub buildFinished {
, dependents => [grep { $_->id != $build->id } @builds] , dependents => [grep { $_->id != $build->id } @builds]
, baseurl => $self->{config}->{'base_uri'} || "http://localhost:3000" , baseurl => $self->{config}->{'base_uri'} || "http://localhost:3000"
, showJobName => \&showJobName, showStatus => \&showStatus , showJobName => \&showJobName, showStatus => \&showStatus
, showSystem => index($build->job->name, $build->system) == -1
}; };
my $body; my $body;
@ -146,7 +147,7 @@ sub buildFinished {
header => [ header => [
To => $to, To => $to,
From => "Hydra Build Daemon <$sender>", From => "Hydra Build Daemon <$sender>",
Subject => showStatus($build) . ": Hydra job " . showJobName($build) . " on " . $build->system, Subject => showStatus($build) . ": Hydra job " . showJobName($build) . ($vars->{showSystem} ? " on " . $build->system : ""),
'X-Hydra-Instance' => $vars->{baseurl}, 'X-Hydra-Instance' => $vars->{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,