summaryrefslogtreecommitdiff
path: root/githooks
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-03-04 15:23:07 +0100
committerFlorian Dold <florian.dold@gmail.com>2016-03-04 15:23:07 +0100
commit67edb8d525d0931ed423e6cc7fdd0778b8d11823 (patch)
treeaf72907c9b68dd5ba112fc549789bb3aa87460d5 /githooks
parent8f5bfa4f042fd9b471a4e870d69a9abde6d10b2e (diff)
downloaddeployment-67edb8d525d0931ed423e6cc7fdd0778b8d11823.tar.gz
deployment-67edb8d525d0931ed423e6cc7fdd0778b8d11823.tar.bz2
deployment-67edb8d525d0931ed423e6cc7fdd0778b8d11823.zip
githook
Diffstat (limited to 'githooks')
-rwxr-xr-xgithooks/merchant/post-receive15
1 files changed, 11 insertions, 4 deletions
diff --git a/githooks/merchant/post-receive b/githooks/merchant/post-receive
index 54afab2..77a817d 100755
--- a/githooks/merchant/post-receive
+++ b/githooks/merchant/post-receive
@@ -5,13 +5,20 @@ import os
lines = sys.stdin.readlines()
-updated = {}
+updated = set()
for line in lines:
- old, new, name = line.split()
+ try:
+ old, new, name = line.split()
+ except ValueError:
+ print("unexpected format")
+ os.exit(1)
updated.add(name)
if "refs/heads/test" in updated:
- os.system("echo merchant | timeout 1s tee rebuild")
- print("updating merchant")
+ ret = os.system("echo merchant | timeout 1s tee /home/test/rebuild >/dev/null")
+ if ret != 0:
+ print("merchant update failed")
+ else:
+ print("updating merchant")