aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/mgagit
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-02-10 09:25:52 +0000
committerColin Guthrie <colin@mageia.org>2014-02-10 09:25:52 +0000
commit09098d4c429f7c96eef1ea58230d9f50dbdc90d4 (patch)
tree9cd57782444e0322b9d373f82ce97dcd5da0987c /deployment/mgagit
parent6ce634bc206043d64020552ce6eda892425cf5e4 (diff)
downloadpuppet-09098d4c429f7c96eef1ea58230d9f50dbdc90d4.tar
puppet-09098d4c429f7c96eef1ea58230d9f50dbdc90d4.tar.gz
puppet-09098d4c429f7c96eef1ea58230d9f50dbdc90d4.tar.bz2
puppet-09098d4c429f7c96eef1ea58230d9f50dbdc90d4.tar.xz
puppet-09098d4c429f7c96eef1ea58230d9f50dbdc90d4.zip
alamut: Remove rsyncing from git.
Add in notification of the 'on-the-pull' system for mirroring in post-commit hook.
Diffstat (limited to 'deployment/mgagit')
-rwxr-xr-xdeployment/mgagit/templates/git-post-receive-hook33
1 files changed, 22 insertions, 11 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:])