2017-03-13 17:18:22 +01:00
|
|
|
|
package Hydra::Plugin::CompressLog;
|
|
|
|
|
|
|
|
|
|
use strict;
|
2021-08-19 16:36:43 -04:00
|
|
|
|
use warnings;
|
2017-03-13 17:18:22 +01:00
|
|
|
|
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;
|