From 7bba3b9e9c3089bc0f88734cc83ed0fb669e2678 Mon Sep 17 00:00:00 2001 From: Lauren Perry Date: Wed, 17 Dec 2014 12:40:22 +0000 Subject: Install githook to add Change-Id value to commit message --- firehose/plugin/firehose_plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) 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() -- cgit v1.2.1