summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauren Perry <lauren.perry@codethink.co.uk>2014-12-12 11:39:37 +0000
committerLauren Perry <lauren.perry@codethink.co.uk>2014-12-17 12:36:50 +0000
commite9591f4911d2895c0f20c3a54cb2886bbae3e961 (patch)
treeac58b7110d1a5f4e613ff130a55dc5a5d8998a0d
parentb2f071304a6e16fa219514f656fec9c3161fd6d3 (diff)
downloadfirehose-e9591f4911d2895c0f20c3a54cb2886bbae3e961.tar.gz
Modify firehose email configuration and push location
to ensure commits are pushed to the testgerrit server with an appropriate commit message and branch name
-rw-r--r--firehose/plugin/firehose_plugin.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/firehose/plugin/firehose_plugin.py b/firehose/plugin/firehose_plugin.py
index 25e2eb4..fba1db3 100644
--- a/firehose/plugin/firehose_plugin.py
+++ b/firehose/plugin/firehose_plugin.py
@@ -31,7 +31,7 @@ def firehose_git(app):
username = (app.runcmd_unchecked(["git", "config", "--global", "user.name"]))[1].strip()
email = (app.runcmd_unchecked(["git", "config", "--global", "user.email"]))[1].strip()
app.runcmd(["git", "config", "--global", "user.name", "Firehose merge bot"])
- app.runcmd(["git", "config", "--global", "user.email", "firehose@merge.bot"])
+ app.runcmd(["git", "config", "--global", "user.email", "firehose@firehose.baserock.org"])
yield ()
finally:
app.runcmd(["git", "config", "--global", "user.name", username])
@@ -86,7 +86,7 @@ class FirehosePlugin(cliapp.Plugin):
for c in confs:
self.update_for_conf(c)
if self.updated_morphologies():
- self.commit_and_push()
+ self.commit_and_push(os.path.basename(fname.replace(".yaml", "")))
def make_path(self, *subpath):
return os.path.join(self.base_path, *subpath)
@@ -230,11 +230,13 @@ class FirehosePlugin(cliapp.Plugin):
return True
- def commit_and_push(self):
+ def commit_and_push(self, name):
+ commit_msg = 'Update to '+name+' ref in definitions.git'
+ branch_name = 'HEAD:refs/for/master/firehose/'+name
(code, out, err) = self.app.runcmd_unchecked(
- ['git', 'commit', '-a', '-m', 'Firehose test commit'],
+ ['git', 'commit', '-a', '-m', commit_msg],
cwd=self.gitpath)
if code == 0:
- self.app.runcmd(['git', 'push', 'origin', 'HEAD'],
- cwd=self.gitpath)
+ self.app.runcmd(['git', 'push', 'ssh://firehose@testgerrit.baserock.org:29418/baserock/baserock/definitions',
+ branch_name], cwd=self.gitpath)