hydra-server: Support logs in S3
This commit is contained in:
@ -13,10 +13,17 @@ sub process {
|
||||
|
||||
my $fh = new IO::Handle;
|
||||
|
||||
my $tail = int($c->stash->{tail} // "0");
|
||||
|
||||
if ($logPath =~ /\.bz2$/) {
|
||||
open $fh, "bzip2 -dc < '$logPath' |" or die;
|
||||
my $doTail = $tail ? " tail -n '$tail' |" : "";
|
||||
open $fh, "bzip2 -dc < '$logPath' | $doTail" or die;
|
||||
} else {
|
||||
open $fh, "<$logPath" or die;
|
||||
if ($tail) {
|
||||
open $fh, "tail -n '$tail' '$logPath' |" or die;
|
||||
} else {
|
||||
open $fh, "<$logPath" or die;
|
||||
}
|
||||
}
|
||||
binmode($fh);
|
||||
|
||||
|
@ -13,17 +13,18 @@ __PACKAGE__->config(
|
||||
|
||||
sub buildLogExists {
|
||||
my ($self, $c, $build) = @_;
|
||||
return 1 if defined $c->config->{log_prefix};
|
||||
my @outPaths = map { $_->path } $build->buildoutputs->all;
|
||||
return defined findLog($c, $build->drvpath, @outPaths);
|
||||
}
|
||||
|
||||
sub buildStepLogExists {
|
||||
my ($self, $c, $step) = @_;
|
||||
return 1 if defined $c->config->{log_prefix};
|
||||
my @outPaths = map { $_->path } $step->buildstepoutputs->all;
|
||||
return defined findLog($c, $step->drvpath, @outPaths);
|
||||
}
|
||||
|
||||
|
||||
sub stripSSHUser {
|
||||
my ($self, $c, $name) = @_;
|
||||
if ($name =~ /^.*@(.*)$/) {
|
||||
|
Reference in New Issue
Block a user