From 503462ba4433cef0cf10deaf9595a431157832ee Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 22 Feb 2015 19:52:18 +0100 Subject: redesign to use force pushes only if necessary, to avoid race conditions, and to add email reports --- webhook.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'webhook.py') diff --git a/webhook.py b/webhook.py index a7ae5f8..034427a 100755 --- a/webhook.py +++ b/webhook.py @@ -10,6 +10,7 @@ def is_github(remote_addr): for net in github['hooks']: if remote_addr in ip_network(net): return True + return False # get repository from query string query = os.getenv("QUERY_STRING") @@ -18,5 +19,5 @@ repository = query.get('repository', []) repository = repository[0] if len(repository) else '' # execute the actual script -git_mirror = "/home/ralf/git-mirror/update.py" -os.execlp("sudo", "sudo", "-n", "-u", "git", git_mirror, "--web-hook", "--repository", repository) +webhook_core = "/home/ralf/git-mirror/webhook-core.py" +os.execlp("sudo", "sudo", "-n", "-u", "git", webhook_core, repository) -- cgit v1.2.3