summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-03-04 16:08:00 +0100
committerFlorian Dold <florian.dold@gmail.com>2016-03-04 16:08:00 +0100
commit5acb21d25531fb1e647880afdaa7cfcfad258f1d (patch)
tree7873b03648d51eab7e1dc1cf7fa3650e1f02a087
parent78b362a3b92b504530e0870735a27cd1d8039417 (diff)
downloaddeployment-5acb21d25531fb1e647880afdaa7cfcfad258f1d.tar.gz
deployment-5acb21d25531fb1e647880afdaa7cfcfad258f1d.tar.bz2
deployment-5acb21d25531fb1e647880afdaa7cfcfad258f1d.zip
revert post-receive
-rwxr-xr-xgithooks/merchant/post-receive25
1 files changed, 23 insertions, 2 deletions
diff --git a/githooks/merchant/post-receive b/githooks/merchant/post-receive
index dac4c53..77a817d 100755
--- a/githooks/merchant/post-receive
+++ b/githooks/merchant/post-receive
@@ -1,3 +1,24 @@
-#!/bin/sh
+#!/usr/bin/python3
+
+import sys
+import os
+
+lines = sys.stdin.readlines()
+
+updated = set()
+
+for line in lines:
+ try:
+ old, new, name = line.split()
+ except ValueError:
+ print("unexpected format")
+ os.exit(1)
+ updated.add(name)
+
+if "refs/heads/test" in updated:
+ ret = os.system("echo merchant | timeout 1s tee /home/test/rebuild >/dev/null")
+ if ret != 0:
+ print("merchant update failed")
+ else:
+ print("updating merchant")
-exec git update-server-info