post-receive: Don't actually update servers on push to test-post-receive

Fixes #924.

(imported from commit 85789b39ef2665901c8a7c9560ef072d80d5e24d)
This commit is contained in:
Keegan McAllister 2013-03-18 17:21:13 -04:00
parent b38a538f8c
commit e8aec9d009
1 changed files with 5 additions and 3 deletions

View File

@ -39,14 +39,16 @@ def update_deployment(server, oldrev, newrev, refname):
deployments = {
'refs/heads/prod': ('humbughq.com', 'prod'),
'refs/heads/master': ('staging.humbughq.com', 'master'),
'refs/heads/test-post-receive': ('staging.humbughq.com', 'master'),
'refs/heads/test-post-receive': None,
}
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/bots/githook-post-receive",
stdin=subprocess.PIPE)
p.communicate(input=ln)
update_deployment(server, oldrev, newrev, "origin/" + branch)
if deployments[refname]:
server, branch = deployments[refname]
update_deployment(server, oldrev, newrev, "origin/" + branch)