Add a hydra.conf option to enable email notification

Note that it's disabled by default.
This commit is contained in:
Eelco Dolstra
2018-03-12 13:52:36 +01:00
parent c0fac52872
commit 02888105a8
4 changed files with 9 additions and 2 deletions

View File

@ -47,6 +47,8 @@ sub jobset_GET {
$c->stash->{totalShares} = getTotalShares($c->model('DB')->schema);
$c->stash->{emailNotification} = $c->config->{email_notification} // 0;
$self->status_ok($c, entity => $c->stash->{jobset});
}
@ -173,6 +175,7 @@ sub edit : Chained('jobsetChain') PathPart Args(0) {
$c->stash->{edit} = !defined $c->stash->{params}->{cloneJobset};
$c->stash->{cloneJobset} = defined $c->stash->{params}->{cloneJobset};
$c->stash->{totalShares} = getTotalShares($c->model('DB')->schema);
$c->stash->{emailNotification} = $c->config->{email_notification} // 0;
}

View File

@ -44,6 +44,8 @@ EOF
sub buildFinished {
my ($self, $build, $dependents) = @_;
return unless $self->{config}->{email_notification} // 0;
die unless $build->finished;
# Figure out to whom to send notification for each build. For