From 13f85455f82d4191d08fe48989830ee0e6989367 Mon Sep 17 00:00:00 2001 From: Mercier Pierre-Olivier Date: Sun, 15 Sep 2013 12:33:34 +0200 Subject: [PATCH] Create long tag after project creation --- hooks/subjects.pl | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) 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