diff --git a/hooks/subjects.pl b/hooks/subjects.pl index eae20dc..0d36a26 100755 --- a/hooks/subjects.pl +++ b/hooks/subjects.pl @@ -153,7 +153,7 @@ sub tag_project $token = sha1_base64(rand); $token =~ s/[^a-zA-Z0-9]//g; } while (length $token < 12); - $vcs->setAttribute("token", $token); + $vcs->setAttribute("token", substr($token, 2, 23)); $mod = 1; } } @@ -187,12 +187,18 @@ sub tag_project } } - # FIXME: Remove next line after 2016 piscine: ça ne devrait pas être fait à ce moment là - eval { - API::Projects::gen_groups($project_id, $year); - }; - if($@) { - log ERROR, $_; + log DONE, "Projet créé/mis à jour avec succès."; + + # Add full tag + if (!$_[3]) + { + my $proj_id = $_[2] // ""; + my $year = $_[3] // LDAP::get_year(); + my $tag = "project,$proj_id,$year"; + qx(git tag -f $tag); + if (! $?) { + log INFO, "Tag long créé : $tag."; + } } } else