aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdeployment/mgagit/templates/git-post-receive-hook33
-rw-r--r--manifests/nodes/alamut.pp7
2 files changed, 22 insertions, 18 deletions
diff --git a/deployment/mgagit/templates/git-post-receive-hook b/deployment/mgagit/templates/git-post-receive-hook
index c8265767..04b746cd 100755
--- a/deployment/mgagit/templates/git-post-receive-hook
+++ b/deployment/mgagit/templates/git-post-receive-hook
@@ -13,6 +13,8 @@ import xmlrpclib
from cookielib import LWPCookieJar
from bugz.bugzilla import BugzillaProxy
+import urllib2
+
# When editing this list, remember to edit the same list in
# modules/cgit/templates/filter.commit-links.sh
BUG_REFS = {
@@ -39,21 +41,21 @@ Mageia Git Monkeys.
"""
git_multimail.REVISION_FOOTER_TEMPLATE = git_multimail.FOOTER_TEMPLATE
+REPO_NAME_RE = re.compile(r'^/git/(?P<name>.+?)(?:\.git)?$')
+def repo_shortname():
+ basename = os.path.abspath(git_multimail.get_git_dir())
+ m = REPO_NAME_RE.match(basename)
+ if m:
+ return m.group('name')
+ else:
+ return basename
+
+
# Override the Environment class to generate an apporpriate short name which is
# used in git links and as an email prefix
class LinksEnvironment(git_multimail.Environment):
- REPO_NAME_RE = re.compile(r'^/git/(?P<name>.+?)(?:\.git)?$')
-
def get_repo_shortname(self):
- """Use the last part of the repo path, with ".git" stripped off if present."""
-
- basename = os.path.abspath(self.get_repo_path())
- m = self.REPO_NAME_RE.match(basename)
- if m:
- return m.group('name')
- else:
- return basename
-
+ return repo_shortname()
git_multimail.Environment = LinksEnvironment
# Override the Reviesion class to inject gitweb/cgit links and any referenced
@@ -182,4 +184,13 @@ if __name__ == '__main__':
except Exception:
pass
+ try:
+ req = urllib2.Request('http://alamut.mageia.org:8000', repo_shortname())
+ req.add_header('Content-Type', 'x-git/repo')
+ fp = urllib2.urlopen(req)
+ if (fp)
+ fp.close()
+ except Exception:
+ pass
+
git_multimail.main(sys.argv[1:])
diff --git a/manifests/nodes/alamut.pp b/manifests/nodes/alamut.pp
index c74a2589..1ed9d9f0 100644
--- a/manifests/nodes/alamut.pp
+++ b/manifests/nodes/alamut.pp
@@ -140,11 +140,4 @@ node alamut {
port => '4252',
proto => 'tcp',
}
-
- # temporary rsync of git repos
- cron { sync_git:
- command => '/usr/bin/rsync -aH --delete rsync://valstar.mageia.org/git/ /git/',
- user => 'git',
- minute => '*/5',
- }
}