Move log compression to a plugin

This commit is contained in:
Eelco Dolstra
2017-03-13 17:18:22 +01:00
parent 285754aff6
commit 7e6486e694
4 changed files with 27 additions and 85 deletions

View File

@ -0,0 +1,19 @@
package Hydra::Plugin::CompressLog;
use strict;
use utf8;
use parent 'Hydra::Plugin';
use Hydra::Helper::CatalystUtils;
sub stepFinished {
my ($self, $step, $logPath) = @_;
my $doCompress = $self->{config}->{'compress_build_logs'} // "1";
if ($doCompress eq "1" && -e $logPath) {
print STDERR "compressing $logPath...\n";
system("bzip2", "--force", $logPath);
}
}
1;