From a4d4f0ab97c6fe64eedb502037b9dad554bb7de7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 31 Mar 2015 12:26:34 +0100 Subject: Config file can be used to set git parameters You can optionally set git username and password Change-Id: Ic94f9b513550c4870613a90ed3fbcf2b65d6e4cc --- firehose/plugin/firehose_plugin.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/firehose/plugin/firehose_plugin.py b/firehose/plugin/firehose_plugin.py index 05460f8..b1ddad6 100644 --- a/firehose/plugin/firehose_plugin.py +++ b/firehose/plugin/firehose_plugin.py @@ -90,6 +90,7 @@ class FirehosePlugin(cliapp.Plugin): firehose_git(self.app): self.base_path = tfs.getsyspath("/") self.make_workspace() + self.setup_git() self.make_branch(confs[0].landing) self.log_sha(os.path.basename(fname.replace('.yaml',''))) self.insert_githook() @@ -106,6 +107,13 @@ class FirehosePlugin(cliapp.Plugin): def make_workspace(self): self.app.subcommands['init']([self.make_path("ws")]) + def setup_git(self): + git_username = self.app.settings['git-username'] + git_email = self.app.settings['git-email'] + if (len(git_username) > 1) and (len(git_email) > 1): + self.app.runcmd(['git', 'config', '--global', 'user.name', git_username]) + self.app.runcmd(['git', 'config', '--global', 'user.email', git_email]) + def make_branch(self, root): os.chdir(self.make_path("ws")) try: -- cgit v1.2.1