From 8703117109e67e9e6d5c2ae6d7ee4dcf63c72f83 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Tue, 13 May 2014 17:17:22 +0000 Subject: Add distbuild-morphology command. This is useful to build releases using distbuild. It avoids having the SHA1 fields in the artifact metadata files pointing to commits that exist only on temporary build branches. It also avoids file:// URLs in the repo fields. Note that the repo URL still points to the Trove used by the distbuild network, rather than being an upstream URL pointing to git.baserock.org. --- morphlib/plugins/build_plugin.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/morphlib/plugins/build_plugin.py b/morphlib/plugins/build_plugin.py index 62009bcd..fb7efa5b 100644 --- a/morphlib/plugins/build_plugin.py +++ b/morphlib/plugins/build_plugin.py @@ -28,6 +28,9 @@ class BuildPlugin(cliapp.Plugin): arg_synopsis='(REPO REF FILENAME)...') self.app.add_subcommand('build', self.build, arg_synopsis='SYSTEM') + self.app.add_subcommand('distbuild-morphology', + self.distbuild_morphology, + arg_synopsis='SYSTEM') self.app.add_subcommand('distbuild', self.distbuild, arg_synopsis='SYSTEM') self.use_distbuild = False @@ -35,6 +38,26 @@ class BuildPlugin(cliapp.Plugin): def disable(self): self.use_distbuild = False + def distbuild_morphology(self, args): + '''Distbuild a system, outside of a system branch. + + Command line arguments: + + * `REPO` is a git repository URL. + * `REF` is a branch or other commit reference in that repository. + * `FILENAME` is a morphology filename at that ref. + + See 'help distbuild' and 'help build-morphology' for more information. + + ''' + + addr = self.app.settings['controller-initiator-address'] + port = self.app.settings['controller-initiator-port'] + + build_command = morphlib.buildcommand.InitiatorBuildCommand( + self.app, addr, port) + build_command.build(args) + def distbuild(self, args): '''Distbuild a system image in the current system branch -- cgit v1.2.1