* Get the URI for use in notification mails from the Hydra config

file.
This commit is contained in:
Eelco Dolstra 2009-07-10 09:47:42 +00:00
parent 1ca935e31a
commit abe0a8eb9d

View file

@ -10,6 +10,7 @@ use Email::Sender::Transport::SMTP;
use Email::Simple; use Email::Simple;
use Email::Simple::Creator; use Email::Simple::Creator;
use Sys::Hostname::Long; use Sys::Hostname::Long;
use Config::General;
STDOUT->autoflush(); STDOUT->autoflush();
@ -17,6 +18,9 @@ STDOUT->autoflush();
my $db = openHydraDB; my $db = openHydraDB;
my %config = new Config::General($ENV{"HYDRA_CONF"})->getall;
sub getBuildLog { sub getBuildLog {
my ($drvPath) = @_; my ($drvPath) = @_;
my $logPath = "/nix/var/log/nix/drvs/" . basename $drvPath; my $logPath = "/nix/var/log/nix/drvs/" . basename $drvPath;
@ -52,7 +56,7 @@ sub sendEmailNotification {
my $sender = ($ENV{'USER'} || "hydra") . "@" . hostname_long . "\n"; my $sender = ($ENV{'USER'} || "hydra") . "@" . hostname_long . "\n";
my $selfURI = $ENV{'HYDRA_BASE_URI'} || "http://localhost:3000/"; my $selfURI = $config{'base_uri'} || "http://localhost:3000";
my $body = "Hi,\n" my $body = "Hi,\n"
. "\n" . "\n"