diff options
author | Ralf Jung <post@ralfj.de> | 2015-02-22 19:52:18 +0100 |
---|---|---|
committer | Ralf Jung <post@ralfj.de> | 2015-02-22 19:52:18 +0100 |
commit | 503462ba4433cef0cf10deaf9595a431157832ee (patch) | |
tree | 9610895981f7f5f2de5cd2bf383a4408dd138c9b /webhook.py | |
parent | 7373610f7eb8e516b6610370411b57a20e7af2a0 (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-x | webhook.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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) |