mirror of
https://github.com/zulip/zulip.git
synced 2026-07-18 21:04:19 +08:00
Fix post-receive hook arguments issues and document the setup.
(imported from commit 0440cbc97337b8dd9f92bbbd428a069f79df400a)
This commit is contained in:
parent
4c037a938c
commit
cdedb85934
1
bots/githook-post-receive
Symbolic link
1
bots/githook-post-receive
Symbolic link
@ -0,0 +1 @@
|
||||
../api/integrations/git/post-receive
|
||||
@ -7,6 +7,18 @@
|
||||
#
|
||||
# ssh humbug@git.humbughq.com 'cd humbug; git pull'
|
||||
#
|
||||
# To send the Humbug notices, this script calls out to our
|
||||
# for-distribution git hook (under api/integrations/); since the git
|
||||
# hook needs to be in the same directory as the configuration script
|
||||
# for the git hook, this means that we need to have a shared directory
|
||||
# containing (a symlink to) both the the for-distribution git hook and
|
||||
# the Humbug configuration; for the moment those are
|
||||
# bots/githook-post-receive and bots/humbug_git_config.py,
|
||||
# respectively. We need the intermediate symlink because the git hook
|
||||
# looks for its configuration in the directory that it sits in, and
|
||||
# api/integrations/git/ has the example configuration.
|
||||
#
|
||||
#
|
||||
# The "post-receive" script is run after receive-pack has accepted a pack
|
||||
# and the repository has been updated. It is passed arguments in through
|
||||
# stdin in the form
|
||||
@ -49,7 +61,7 @@ for ln in sys.stdin:
|
||||
oldrev, newrev, refname = ln.strip().split()
|
||||
if refname in deployments:
|
||||
(server, branch) = deployments[refname]
|
||||
p = subprocess.Popen("/home/humbug/humbug/api/integrations/git/post-receive",
|
||||
p = subprocess.Popen("/home/humbug/humbug/bots/githook-post-receive",
|
||||
stdin=subprocess.PIPE)
|
||||
p.communicate(input=ln)
|
||||
update_deployment(server, oldrev, newrev, branch)
|
||||
update_deployment(server, oldrev, newrev, "origin/" + branch)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user