Interact with new intranet group API
This commit is contained in:
parent
27f7b7c9ce
commit
1f61b7a144
3 changed files with 135 additions and 0 deletions
35
commands/project/gen_git_str.pl
Normal file
35
commands/project/gen_git_str.pl
Normal file
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use v5.10;
|
||||
use Data::Dumper;
|
||||
|
||||
use ACU::API::Projects;
|
||||
|
||||
my $projid = $ARGV[0];
|
||||
my $year = $ARGV[1] // LDAP::get_year;
|
||||
|
||||
my $res = API::Projects::get_groups($projid, $year);
|
||||
my $tag = "rendu-1";
|
||||
|
||||
map {
|
||||
my $chief;
|
||||
|
||||
# First, found the chief
|
||||
for my $member (@{ $_->{stds} })
|
||||
{
|
||||
if ($member->{chief} eq "true" or $member->{chief} eq "1" or $member->{chief} eq "chief")
|
||||
{
|
||||
$chief = $member;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
say "repo $year/$projid/$chief->{login}";
|
||||
print ' RW+ = @admins';
|
||||
for my $member (@{ $_->{stds} }) {
|
||||
print ' '.$member->{login};
|
||||
}
|
||||
say "\n R = \@chefs \@resp-$year-$projid";
|
||||
} @{ $res->{groups} };
|
Reference in a new issue