New hook post-update
This commit is contained in:
parent
84c34f8fea
commit
dfb66035eb
3 changed files with 103 additions and 33 deletions
|
|
@ -52,7 +52,7 @@ if ($ref =~ m<^refs/tags/(.+)$>)
|
|||
my $err = $@;
|
||||
log TRACE, $err;
|
||||
log ERROR, "Impossible d'envoyer de tags ; si le problème persiste, passez au laboratoire.";
|
||||
exit 1;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
log TRACE, $project;
|
||||
|
|
@ -119,40 +119,13 @@ if ($ref =~ m<^refs/tags/(.+)$>)
|
|||
}
|
||||
}
|
||||
|
||||
if ($newsha eq '0' x 40) {
|
||||
log USAGE, "Mais pour quelle raison voudriez-vous supprimer un tag ?!";
|
||||
}
|
||||
else
|
||||
if (@rendus && $newsha eq '0' x 40)
|
||||
{
|
||||
eval {
|
||||
Process::Client::launch("send_git",
|
||||
{
|
||||
"year" => $promo,
|
||||
"id" => $id_project,
|
||||
"rendu" => $tag,
|
||||
"login" => $repo_login,
|
||||
# "path" => "ssh://git\@localhost/".$ENV{GL_REPO},
|
||||
}, undef, 1);
|
||||
};
|
||||
if ($@) {
|
||||
my $err = $@;
|
||||
log DEBUG, "ERROR: ".$err;
|
||||
}
|
||||
|
||||
# Send data to API
|
||||
my $last_commit = `git log $newsha -1 --decorate --tags`;
|
||||
eval {
|
||||
API::Submission::add($promo, $id_project, $tag, $repo_login, $last_commit);
|
||||
};
|
||||
if ($@) {
|
||||
my $err = $@;
|
||||
log DEBUG, "ERROR: ".$err;
|
||||
log DONE, "Tag '$tag' effectué avec succès !";
|
||||
}
|
||||
else {
|
||||
log DONE, "Tag '$tag' effectué avec succès ! Vérifiez-le sur l'intranet.";
|
||||
}
|
||||
log USAGE, "Mais pour quelle raison voudriez-vous supprimer un tag ?!";
|
||||
exit(7);
|
||||
}
|
||||
# elsif @rendus : new rendu => accepted
|
||||
# else user defined tag => accepted
|
||||
}
|
||||
|
||||
exit 0;
|
||||
|
|
|
|||
Reference in a new issue