post-update hook: ACU-
This commit is contained in:
parent
4af0617cae
commit
ba19732a47
@ -31,21 +31,28 @@ exit(0) if (!$promo || !$id_project || !$repo_login);
|
||||
for my $ref (@ARGV)
|
||||
{
|
||||
my $tag;
|
||||
if ($ref =~ m<^refs/tags/ACU-(.+)$>) {
|
||||
my $tag_for;
|
||||
if ($ref =~ m<^refs/tags/(ACU-(.+))$>)
|
||||
{
|
||||
$tag = $1;
|
||||
} elsif ($ref =~ m<^refs/tags/(.+)$>) {
|
||||
$tag_for = $2;
|
||||
}
|
||||
elsif ($ref =~ m<^refs/tags/(.+)$>)
|
||||
{
|
||||
$tag = $1;
|
||||
} else {
|
||||
$tag_for = $1;
|
||||
}
|
||||
else {
|
||||
next;
|
||||
}
|
||||
|
||||
log DEBUG, "Tag $tag on repository $ENV{GL_REPO} from IP $ENV{'SSH_CLIENT'} updated.";
|
||||
log DEBUG, "Tag $tag ($tag_for) on repository $ENV{GL_REPO} from IP $ENV{'SSH_CLIENT'} updated.";
|
||||
|
||||
my $project = get_project_info($tag);
|
||||
my $project = get_project_info($tag_for);
|
||||
|
||||
# Extract matching tag
|
||||
my @rendus = grep {
|
||||
exists $_->{vcs} and $_->{vcs}{tag} eq $tag;
|
||||
exists $_->{vcs} and $_->{vcs}{tag} eq $tag_for;
|
||||
} @{ $project->{submissions} };
|
||||
|
||||
if (@rendus)
|
||||
@ -73,7 +80,7 @@ for my $ref (@ARGV)
|
||||
# Send data to API
|
||||
my $last_commit = `git log "refs/tags/$tag" -1 --decorate --tags`;
|
||||
eval {
|
||||
API::Submission::add($promo, $id_project, $tag, $repo_login, $last_commit);
|
||||
API::Submission::add($promo, $id_project, $tag_for, $repo_login, $last_commit);
|
||||
};
|
||||
if ($@)
|
||||
{
|
||||
@ -103,7 +110,7 @@ sub get_project_info
|
||||
exit(1);
|
||||
}
|
||||
|
||||
log TRACE, $project;
|
||||
#log TRACE, $project;
|
||||
|
||||
return $project;
|
||||
}
|
||||
|
Reference in New Issue
Block a user