Archived
1
0

Use FQDN instead of relative domain in sync_ssh_keys

This commit is contained in:
Mercier Pierre-Olivier 2013-09-16 18:56:48 +02:00
parent 4ced1e540e
commit 4649360306
2 changed files with 15 additions and 2 deletions

View File

@ -24,8 +24,11 @@ my $repo_login = $1 if ($ENV{'GL_REPO'} =~ m/.*\/.*\/(.*)/);
if ($ref =~ m<^refs/tags/(.+)$>)
{
my $ip = $1 if ($ENV{'SSH_CLIENT'} =~ m/([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*/);
say "[ACU] Your IP is: $ENV{'SSH_CLIENT'}.";
my $tag = $1;
log DEBUG, "Pushed tag for repository $ENV{GL_REPO}: $tag";
log DEBUG, "Pushed tag for repository $ENV{GL_REPO}: $tag with IP $ENV{'SSH_CLIENT'}";
# Get project informations
my $project;
@ -95,3 +98,13 @@ if ($ref =~ m<^refs/tags/(.+)$>)
}
exit 0;
sub ip2long
{
return unpack("l*", pack("l*", unpack("N*", inet_aton(shift))));
}
sub long2ip
{
return inet_ntoa(pack("N*", shift));
}

View File

@ -109,7 +109,7 @@ if ($0 =~ /^(?:.*\/)?sync_ssh_keys_(?:([a-zA-Z0-9]+)_)?([a-zA-Z0-9]+).pl$/) {
if ($service eq "git")
{
$Git::git_server = $2;
$Git::git_server = $2.".acu.epita.fr";
log INFO, "Start by syncing all users key...";