automatic reload of tail log when build is running

This commit is contained in:
Rob Vermaas
2011-02-02 09:00:52 +00:00
parent 9aeaef80fc
commit 559ab9c97a
3 changed files with 16 additions and 4 deletions

View File

@ -127,6 +127,16 @@ sub showLog {
$c->forward('Hydra::View::Plain');
}
elsif ($mode eq "tail-reload") {
my $url = $c->request->uri->as_string;
$url =~ s/tail-reload/tail/g;
$c->stash->{url} = $url;
$c->stash->{reload} = defined $c->stash->{build}->schedulingInfo && $c->stash->{build}->schedulingInfo->busy;
$c->stash->{title} = "";
$c->stash->{contents} = (scalar `$pipestart | tail -n 50`) || " ";
$c->stash->{template} = 'plain-reload.tt';
}
elsif ($mode eq "tail") {
$c->stash->{'plain'} = { data => (scalar `$pipestart | tail -n 50`) || " " };
$c->forward('Hydra::View::Plain');