diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-03-04 15:23:07 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-03-04 15:23:07 +0100 |
commit | 67edb8d525d0931ed423e6cc7fdd0778b8d11823 (patch) | |
tree | af72907c9b68dd5ba112fc549789bb3aa87460d5 /githooks | |
parent | 8f5bfa4f042fd9b471a4e870d69a9abde6d10b2e (diff) | |
download | deployment-67edb8d525d0931ed423e6cc7fdd0778b8d11823.tar.gz deployment-67edb8d525d0931ed423e6cc7fdd0778b8d11823.tar.bz2 deployment-67edb8d525d0931ed423e6cc7fdd0778b8d11823.zip |
githook
Diffstat (limited to 'githooks')
-rwxr-xr-x | githooks/merchant/post-receive | 15 |
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") |