aboutsummaryrefslogtreecommitdiffstats
path: root/webhook.py
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2015-02-22 19:52:18 +0100
committerRalf Jung <post@ralfj.de>2015-02-22 19:52:18 +0100
commit503462ba4433cef0cf10deaf9595a431157832ee (patch)
tree9610895981f7f5f2de5cd2bf383a4408dd138c9b /webhook.py
parent7373610f7eb8e516b6610370411b57a20e7af2a0 (diff)
redesign to use force pushes only if necessary, to avoid race conditions, and to add email reports
Diffstat (limited to 'webhook.py')
-rwxr-xr-xwebhook.py5
1 files changed, 3 insertions, 2 deletions
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)