summaryrefslogtreecommitdiff
path: root/firehose/plugin/firehose_plugin.py
diff options
context:
space:
mode:
authorBob Mottram <bob.mottram@codethink.co.uk>2015-03-31 12:26:34 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-06-12 11:19:48 +0000
commita4d4f0ab97c6fe64eedb502037b9dad554bb7de7 (patch)
treec6804800d88a3ff0a0b639d7b8a7076133b99244 /firehose/plugin/firehose_plugin.py
parent5a6c1a08d1b9a0ff76215cace56e15114cf5a59e (diff)
downloadfirehose-a4d4f0ab97c6fe64eedb502037b9dad554bb7de7.tar.gz
Config file can be used to set git parameters
You can optionally set git username and password Change-Id: Ic94f9b513550c4870613a90ed3fbcf2b65d6e4cc
Diffstat (limited to 'firehose/plugin/firehose_plugin.py')
-rw-r--r--firehose/plugin/firehose_plugin.py8
1 files changed, 8 insertions, 0 deletions
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: