summaryrefslogtreecommitdiff
path: root/morphlib/plugins/build_plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/plugins/build_plugin.py')
-rw-r--r--morphlib/plugins/build_plugin.py39
1 files changed, 7 insertions, 32 deletions
diff --git a/morphlib/plugins/build_plugin.py b/morphlib/plugins/build_plugin.py
index 3a489a61..64630c2b 100644
--- a/morphlib/plugins/build_plugin.py
+++ b/morphlib/plugins/build_plugin.py
@@ -184,35 +184,10 @@ class BuildPlugin(cliapp.Plugin):
system=system_filename,
branch=sb.system_branch_name)
- bb = morphlib.buildbranch.BuildBranch(sb, build_ref_prefix,
- push_temporary=push)
- with contextlib.closing(bb) as bb:
- def report_add(gd, build_ref, changed):
- self.app.status(msg='Adding uncommitted changes '\
- 'in %(dirname)s to %(ref)s',
- dirname=gd.dirname, ref=build_ref, chatty=True)
- bb.add_uncommitted_changes(add_cb=report_add)
-
- def report_inject(gd):
- self.app.status(msg='Injecting temporary build refs '\
- 'into morphologies in %(dirname)s',
- dirname=gd.dirname, chatty=True)
- bb.inject_build_refs(loader, inject_cb=report_inject)
-
- def report_commit(gd, build_ref):
- self.app.status(msg='Committing changes in %(dirname)s '\
- 'to %(ref)s',
- dirname=gd.dirname, ref=build_ref, chatty=True)
- bb.update_build_refs(name, email, build_uuid,
- commit_cb=report_commit)
-
- def report_push(gd, build_ref, remote, refspec):
- self.app.status(msg='Pushing %(ref)s in %(dirname)s '\
- 'to %(remote)s',
- ref=build_ref, dirname=gd.dirname,
- remote=remote.get_push_url(), chatty=True)
- bb.push_build_branches(push_cb=report_push)
-
- build_command.build([bb.root_repo_url,
- bb.root_ref,
- system_filename])
+ bb = morphlib.buildbranch.BuildBranch(sb, build_ref_prefix)
+ pbb = morphlib.buildbranch.pushed_build_branch(
+ bb, loader=loader, changes_need_pushing=push,
+ name=name, email=email, build_uuid=build_uuid,
+ status=self.app.status)
+ with pbb as (repo, ref):
+ build_command.build([repo, ref, system_filename])