From e9591f4911d2895c0f20c3a54cb2886bbae3e961 Mon Sep 17 00:00:00 2001 From: Lauren Perry Date: Fri, 12 Dec 2014 11:39:37 +0000 Subject: Modify firehose email configuration and push location to ensure commits are pushed to the testgerrit server with an appropriate commit message and branch name --- firehose/plugin/firehose_plugin.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'firehose') 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) -- cgit v1.2.1