summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauren Perry <lauren.perry@codethink.co.uk>2014-12-17 12:40:22 +0000
committerLauren Perry <lauren.perry@codethink.co.uk>2014-12-17 12:40:22 +0000
commit7bba3b9e9c3089bc0f88734cc83ed0fb669e2678 (patch)
tree41dce40de4fc5d19cba6ffa2a78fc33f21545325
parente9591f4911d2895c0f20c3a54cb2886bbae3e961 (diff)
downloadfirehose-7bba3b9e9c3089bc0f88734cc83ed0fb669e2678.tar.gz
Install githook to add Change-Id value to commit message
-rw-r--r--firehose/plugin/firehose_plugin.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/firehose/plugin/firehose_plugin.py b/firehose/plugin/firehose_plugin.py
index fba1db3..dd6f29b 100644
--- a/firehose/plugin/firehose_plugin.py
+++ b/firehose/plugin/firehose_plugin.py
@@ -81,6 +81,7 @@ class FirehosePlugin(cliapp.Plugin):
self.base_path = tfs.getsyspath("/")
self.make_workspace()
self.make_branch(confs[0].landing)
+ self.insert_githook()
self.reset_to_tracking(confs[0].landing)
self.load_morphologies()
for c in confs:
@@ -106,6 +107,11 @@ class FirehosePlugin(cliapp.Plugin):
repopath = root['repo'].replace(':', '/')
self.gitpath = self.make_path("ws", root['myref'], repopath)
+ def insert_githook(self):
+ scp_cmd = ('scp', '-p', '-P', '29418', 'firehose@testgerrit.baserock.org:hooks/commit-msg',
+ self.gitpath+'/.git/hooks/commit-msg')
+ os.system(' '.join(scp_cmd))
+
def reset_to_tracking(self, root):
branch_head_sha = self.app.runcmd(['git', 'rev-parse', 'HEAD'],
cwd=self.gitpath).strip()