diff options
| author | Ralph Bean <rbean@redhat.com> | 2015-01-29 16:37:49 +0000 |
|---|---|---|
| committer | Ralph Bean <rbean@redhat.com> | 2015-01-29 16:52:02 +0000 |
| commit | beb5348251b45b8e9c248ee24afe9bef7a126e18 (patch) | |
| tree | ccd6dc6b3e22ca9b91d6d864834f150ea3c084c1 /roles/git/hooks | |
| parent | 497f77b7aaf00e9752acfabbbf358af5ab6b72e2 (diff) | |
| download | ansible-beb5348251b45b8e9c248ee24afe9bef7a126e18.tar.gz ansible-beb5348251b45b8e9c248ee24afe9bef7a126e18.tar.xz ansible-beb5348251b45b8e9c248ee24afe9bef7a126e18.zip | |
These misnamed files must be a mistake.
Diffstat (limited to 'roles/git/hooks')
| -rw-r--r-- | roles/git/hooks/files/post-received-chained | 8 | ||||
| -rw-r--r-- | roles/git/hooks/files/post-received-fedmsg | 65 |
2 files changed, 0 insertions, 73 deletions
diff --git a/roles/git/hooks/files/post-received-chained b/roles/git/hooks/files/post-received-chained deleted file mode 100644 index b5c6e2311..000000000 --- a/roles/git/hooks/files/post-received-chained +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Redirect stdin to each of the post-receive hooks in place. - -# You need to explicitly add your hook to the following list -# for it to be invoked. -pee \ - $GIT_DIR/hooks/post-receive-chained.d/post-receive-email \ - $GIT_DIR/hooks/post-receive-chained.d/post-receive-fedmsg diff --git a/roles/git/hooks/files/post-received-fedmsg b/roles/git/hooks/files/post-received-fedmsg deleted file mode 100644 index 7bc9a140d..000000000 --- a/roles/git/hooks/files/post-received-fedmsg +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python - -import getpass -import git -import os -import sys - -import fedmsg -import fedmsg.config - -# Read in all the rev information git-receive-pack hands us. -lines = [line.split() for line in sys.stdin.readlines()] - -# Use $GIT_DIR to determine where this repo is. -abspath = os.path.abspath(os.environ['GIT_DIR']) -repo_name = '.'.join(abspath.split(os.path.sep)[-1].split('.')[:-1]) - -username = getpass.getuser() - -repo = git.repo.Repo(abspath) -def _build_commit(rev): - old, rev, branch = rev - branch = '/'.join(branch.split('/')[2:]) - commit = repo.rev_parse(rev=rev) - - # We just don't handle these - if isinstance(commit, git.TagObject): - return None - - return dict( - name=commit.author.name, - email=commit.author.email, - username=username, - summary=commit.summary, - message=commit.message, - stats=dict( - files=commit.stats.files, - total=commit.stats.total, - ), - rev=rev, - path=abspath, - repo=repo_name, - branch=branch, - agent=os.getlogin(), - ) - -commits = map(_build_commit, lines) - -print "Emitting a message to the fedmsg bus." -config = fedmsg.config.load_config([], None) -config['active'] = True -config['endpoints']['relay_inbound'] = config['relay_inbound'] -fedmsg.init(name='relay_inbound', cert_prefix='scm', **config) - -for commit in commits: - - if commit is None: - continue - - fedmsg.publish( - # Expect this to change to just "receive" in the future. - topic="receive", - msg=dict(commit=commit), - modname="git", - ) |
