diff options
author | Colin Guthrie <colin@mageia.org> | 2014-02-10 09:25:52 +0000 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2014-02-10 09:25:52 +0000 |
commit | 09098d4c429f7c96eef1ea58230d9f50dbdc90d4 (patch) | |
tree | 9cd57782444e0322b9d373f82ce97dcd5da0987c | |
parent | 6ce634bc206043d64020552ce6eda892425cf5e4 (diff) | |
download | puppet-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.
-rwxr-xr-x | deployment/mgagit/templates/git-post-receive-hook | 33 | ||||
-rw-r--r-- | manifests/nodes/alamut.pp | 7 |
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', - } } |