From 92a222d346ff623b5e36fca283861d4ec9b78119 Mon Sep 17 00:00:00 2001 From: Nicolas Geniteau Date: Tue, 5 Nov 2013 17:37:03 +0100 Subject: [PATCH] hook dump-help --- hooks/dump-help.pl | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 hooks/dump-help.pl diff --git a/hooks/dump-help.pl b/hooks/dump-help.pl new file mode 100755 index 0000000..dd8d29f --- /dev/null +++ b/hooks/dump-help.pl @@ -0,0 +1,40 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use v5.10; +use utf8; +use Carp; +use File::Basename; +use File::Path qw(remove_tree); +use File::Temp qw/tempfile tempdir/; + +use ACU::Log; +$ACU::Log::log_file = "/var/log/hooks/" . basename($0) . ".log"; +use ACU::Process; + +# First, check if the repository is dump-help +exit 0 if ($ENV{GL_REPO} ne "dump-help"); + +my ($ref, $oldsha, $newsha) = @ARGV; + +log DONE, "This is the dump-help repository!"; + +exit 0 if ($newsha eq '0' x 40); + +if ($ref eq "refs/tags/release") +{ + + my $archive = qx(git archive --format=tgz $newsha); + #qx(git clone -b release /srv/git/repositories/dump-help.git '$tempdir') or croak "It is not a valid repository."; + + Process::Client::launch("docs_compile", + { + "type" => "dump_help", + "file" => "dump-help.tgz" , + }, + { "dump-help.tgz" => $archive }); + +} + +exit 0;