Archived
1
0
Fork 0

Merge branch 'master' of ssh://cpp/liblerdorf

This commit is contained in:
Root Cpp Charlie 2013-11-04 02:24:12 +01:00
commit 45bae3f39b
5 changed files with 32 additions and 15 deletions

View file

@ -5,7 +5,7 @@ package Git;
use v5.10.1;
use strict;
use warnings;
use File::Path;
use File::Path qw(remove_tree);
use File::Temp;
use ACU::LDAP;
@ -31,7 +31,7 @@ sub init_conf(;$)
log INFO, "Cloning $git_user\@$git_server:$git_adminrepo to $gitolite_directory";
system ("git clone $git_user\@$git_server:$git_adminrepo $gitolite_directory");
qx(git clone $git_user\@$git_server:$git_adminrepo $gitolite_directory);
chdir($gitolite_directory);
@ -43,12 +43,12 @@ sub save_conf(;$)
chdir($gitolite_directory);
my $commit = shift;
system ("git commit -am '$commit'") if ($commit);
qx(git commit -am '$commit') if ($commit);
log INFO, "Saving repositories configuration";
system ("git push");
unlink ($gitolite_directory);
qx(git push);
remove_tree($gitolite_directory);
$gitolite_directory = undef;
}
@ -235,7 +235,7 @@ sub user_add
print $kf $key;
close $kf;
system("git add $gitolite_directory/keydir/$i/$login.pub");
qx(git add $gitolite_directory/keydir/$i/$login.pub);
$i += 1;
}
}

View file

@ -111,8 +111,8 @@ if ($ref =~ m<^refs/tags/(.+)$>)
"id" => $id_project,
"rendu" => $tag,
"login" => $repo_login,
# "path" => "ssh://git@localhost/".$ENV{GL_REPO},
});
# "path" => "ssh://git\@localhost/".$ENV{GL_REPO},
}, undef, 1);
};
if ($@) {
my $err = $@;

View file

@ -37,7 +37,17 @@ sub fact_exec
{
my $cmd = shift;
my $rundir = shift;
jail_exec("cd $rundir && /usr/local/bin/mono /usr/local/fact/FactExe.exe $cmd");
# Check that Fact is running
qx/pgrep mono/;
while ($?)
{
log ERROR, "Fact is not running ... waiting for respawn";
sleep(10);
qx/pgrep mono/;
}
jail_exec("cd '$rundir' && /usr/local/bin/mono /usr/local/fact/FactExe.exe $cmd");
}
sub prepare_dir

View file

@ -20,18 +20,19 @@ sub process
my $rendu = $args->{param}{rendu};
my $login = $args->{param}{login};
my $path = $args->{param}{path} // "ssh://git@localhost/$year/$project_id/$login.git";
my $path = $args->{param}{path} // "ssh://git\@localhost/$year/$project_id/$login.git";
my $tempdir = tempdir();
qx/git clone -b '$rendu' '$path' '$tempdir'/;
qx/git clone -b '$rendu' '$path' '$tempdir'/ or croak "$path is not a valid repository.";
croak "$path is not a valid repository." if (! $?);
croak "$path is not a valid repository." if ($?);
my $tar;
open my $fh, "tar -czf - -C '$tempdir' . |";
open my $fh, "tar -czf - -C '$tempdir' . |" or die ($!);
$tar .= $_ while(<$fh>);
close $fh;
die "Unable to untar: $!" if ($?);
# Clean
remove_tree($tempdir);

View file

@ -57,7 +57,13 @@ then
# Kill old liblersorf screen sessions
if [ "$HOSTNAME" = "ksh" ]
then
killall screen
for i in `pgrep sh`
do
if [ "$$" != "$i" ]
then
pkill "$i"
fi
done
else
echo "$SCREEN -ls" | $SU intradmin | $GREP '[0-9]+\.lerdorf_[a-zA-Z0-9_-]+' |
while read LINE
@ -79,7 +85,7 @@ then
hamano)
launch_screen "lerdorf_process_ldap_sync_ssh_keys_git" "while true; do $PERL ~/liblerdorf/process/ldap/sync_ssh_keys_git.pl; done" ~intradmin/.ssh/git
launch_screen "lerdorf_process_send_git" "while true; do $PERL ~/liblerdorf/process/files/send_git.pl; done"
launch_screen "lerdorf_process_send_git" "while true; do $PERL ~/liblerdorf/process/files/send_git.pl; done" ~intradmin/.ssh/git
;;
moore)