use HYDRA_DATA/hydra.conf as default location for hydra.conf
This commit is contained in:
parent
d4e9f5383b
commit
586f131ebd
|
@ -10,7 +10,7 @@ use Hydra::Helper::CatalystUtils;
|
|||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(
|
||||
isValidPath
|
||||
getHydraPath getHydraDBPath openHydraDB txn_do
|
||||
getHydraPath getHydraDBPath openHydraDB getHydraConf txn_do
|
||||
registerRoot getGCRootsDir gcRootFor
|
||||
getPrimaryBuildsForView
|
||||
getPrimaryBuildTotal
|
||||
|
@ -25,10 +25,16 @@ sub isValidPath {
|
|||
|
||||
sub getHydraPath {
|
||||
my $dir = $ENV{"HYDRA_DATA"} || "/var/lib/hydra";
|
||||
die "The HYDRA_DATA directory does not exist!\n" unless -d $dir;
|
||||
die "The HYDRA_DATA directory ($dir) does not exist!\n" unless -d $dir;
|
||||
return $dir;
|
||||
}
|
||||
|
||||
sub getHydraConf {
|
||||
my $conf = $ENV{"HYDRA_CONF"} || (getHydraPath . "/hydra.conf");
|
||||
die "The HYDRA_CONF file ($conf) does not exist!\n" unless -f $conf;
|
||||
return $conf;
|
||||
}
|
||||
|
||||
|
||||
sub getHydraDBPath {
|
||||
my $db = $ENV{"HYDRA_DBI"};
|
||||
|
|
|
@ -23,8 +23,7 @@ STDOUT->autoflush();
|
|||
my $db = openHydraDB;
|
||||
|
||||
|
||||
my %config = new Config::General($ENV{"HYDRA_CONFIG"})->getall;
|
||||
|
||||
my %config = new Config::General(getHydraConf)->getall;
|
||||
|
||||
sub sendTwitterNotification {
|
||||
my ($build) = @_;
|
||||
|
|
|
@ -18,7 +18,7 @@ use Data::Dump qw(dump);
|
|||
STDOUT->autoflush();
|
||||
|
||||
my $db = openHydraDB;
|
||||
my %config = new Config::General($ENV{"HYDRA_CONFIG"})->getall;
|
||||
my %config = new Config::General(getHydraConf)->getall;
|
||||
|
||||
|
||||
sub fetchInputs {
|
||||
|
|
Loading…
Reference in a new issue