use HYDRA_DATA/hydra.conf as default location for hydra.conf
This commit is contained in:
parent
d4e9f5383b
commit
586f131ebd
3 changed files with 10 additions and 5 deletions
|
@ -10,7 +10,7 @@ use Hydra::Helper::CatalystUtils;
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
our @EXPORT = qw(
|
our @EXPORT = qw(
|
||||||
isValidPath
|
isValidPath
|
||||||
getHydraPath getHydraDBPath openHydraDB txn_do
|
getHydraPath getHydraDBPath openHydraDB getHydraConf txn_do
|
||||||
registerRoot getGCRootsDir gcRootFor
|
registerRoot getGCRootsDir gcRootFor
|
||||||
getPrimaryBuildsForView
|
getPrimaryBuildsForView
|
||||||
getPrimaryBuildTotal
|
getPrimaryBuildTotal
|
||||||
|
@ -25,10 +25,16 @@ sub isValidPath {
|
||||||
|
|
||||||
sub getHydraPath {
|
sub getHydraPath {
|
||||||
my $dir = $ENV{"HYDRA_DATA"} || "/var/lib/hydra";
|
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;
|
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 {
|
sub getHydraDBPath {
|
||||||
my $db = $ENV{"HYDRA_DBI"};
|
my $db = $ENV{"HYDRA_DBI"};
|
||||||
|
|
|
@ -23,8 +23,7 @@ STDOUT->autoflush();
|
||||||
my $db = openHydraDB;
|
my $db = openHydraDB;
|
||||||
|
|
||||||
|
|
||||||
my %config = new Config::General($ENV{"HYDRA_CONFIG"})->getall;
|
my %config = new Config::General(getHydraConf)->getall;
|
||||||
|
|
||||||
|
|
||||||
sub sendTwitterNotification {
|
sub sendTwitterNotification {
|
||||||
my ($build) = @_;
|
my ($build) = @_;
|
||||||
|
|
|
@ -18,7 +18,7 @@ use Data::Dump qw(dump);
|
||||||
STDOUT->autoflush();
|
STDOUT->autoflush();
|
||||||
|
|
||||||
my $db = openHydraDB;
|
my $db = openHydraDB;
|
||||||
my %config = new Config::General($ENV{"HYDRA_CONFIG"})->getall;
|
my %config = new Config::General(getHydraConf)->getall;
|
||||||
|
|
||||||
|
|
||||||
sub fetchInputs {
|
sub fetchInputs {
|
||||||
|
|
Loading…
Reference in a new issue