mirror of https://github.com/zulip/zulip.git
post-receive: Split into update_deployment and send_bot_message
(imported from commit 3e89cb21cf4aa192f6a31457fd91aa5f52e6baa8)
This commit is contained in:
parent
4844d7eb02
commit
e843427e6c
|
@ -37,10 +37,12 @@ def check_output(*popenargs, **kwargs):
|
|||
return output
|
||||
subprocess.check_output = check_output
|
||||
|
||||
def process_push(oldrev, newrev, refname):
|
||||
def update_deployment(oldrev, newrev, refname):
|
||||
subprocess.check_call(["ssh", "app.humbughq.com", "--", "env", "-u", "GIT_DIR",
|
||||
"/home/humbug/humbug/tools/update-deployment",
|
||||
oldrev, newrev, refname])
|
||||
|
||||
def send_bot_message(oldrev, newrev, refname):
|
||||
commits = subprocess.check_output(["git", "log", "--reverse", "--pretty=- **%aN**: %s", "%s..%s" % (oldrev, newrev)])
|
||||
message_data = {
|
||||
"type": "stream",
|
||||
|
@ -58,4 +60,5 @@ def process_push(oldrev, newrev, refname):
|
|||
for ln in sys.stdin:
|
||||
oldrev, newrev, refname = ln.strip().split()
|
||||
if refname in ["refs/heads/master", "refs/heads/test-post-receive"]:
|
||||
process_push(oldrev, newrev, refname)
|
||||
update_deployment(oldrev, newrev, refname)
|
||||
send_bot_message(oldrev, newrev, refname)
|
||||
|
|
Loading…
Reference in New Issue