Add hook for conferences repository
This commit is contained in:
parent
ddd63ece67
commit
b5806fac12
1
Makefile
1
Makefile
|
@ -18,6 +18,7 @@ install:
|
|||
! test -d $(GITOLITE_DEST) || $(MAKEDIR) -p $(GITOLITE_DEST)/update.secondary.d
|
||||
! test -d $(GITOLITE_DEST) || $(COPY) hooks/gl-pre-git $(GITOLITE_DEST)/
|
||||
! test -d $(GITOLITE_DEST) || $(COPY) hooks/subjects.pl $(GITOLITE_DEST)/update.secondary.d/
|
||||
! test -d $(GITOLITE_DEST) || $(COPY) hooks/conferences.pl $(GITOLITE_DEST)/update.secondary.d/
|
||||
! test -d $(GITOLITE_DEST) || $(COPY) hooks/submissions.pl $(GITOLITE_DEST)/update.secondary.d/
|
||||
|
||||
update:
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use v5.10;
|
||||
use Digest::SHA qw(sha1_base64);
|
||||
use File::Basename;
|
||||
use utf8;
|
||||
|
||||
use ACU::API::Projects;
|
||||
use ACU::Defense;
|
||||
use ACU::LDAP;
|
||||
use ACU::Log;
|
||||
$ACU::Log::log_file = "/var/log/hooks/" . basename($0) . ".log";
|
||||
use ACU::Process;
|
||||
|
||||
# First, check if the repository is in the conferences/ directory
|
||||
exit 0 if ($ENV{GL_REPO} !~ /^conferences\//);
|
||||
|
||||
my ($ref, $oldsha, $newsha) = @ARGV;
|
||||
|
||||
log DONE, "This is a conference repository!";
|
||||
|
||||
my %known_tags = (
|
||||
"subject" => \&tag_document,
|
||||
);
|
||||
|
||||
if ($ref =~ m<^refs/tags(/.+)$>)
|
||||
{
|
||||
my $tag = $1;
|
||||
my @args;
|
||||
|
||||
while ($tag =~ m<[,/]([^,]*)>g) {
|
||||
push @args, $1;
|
||||
}
|
||||
|
||||
my $create = ($newsha ne '0' x 40);
|
||||
|
||||
if (exists $known_tags{$args[0]}) {
|
||||
exit $known_tags{$args[0]}($create, @args);
|
||||
}
|
||||
}
|
||||
|
||||
exit 0;
|
||||
|
||||
sub tag_document
|
||||
{
|
||||
|
||||
}
|
Reference in New Issue