summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-05-13 17:17:22 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-05-14 18:00:18 +0000
commit8703117109e67e9e6d5c2ae6d7ee4dcf63c72f83 (patch)
tree7a7becb435779a2bd4b3978ba0e86e537d220ca5
parent090ee65ba03ce50d0ec5dcd41ac77b377779c6ba (diff)
downloadmorph-8703117109e67e9e6d5c2ae6d7ee4dcf63c72f83.tar.gz
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.
-rw-r--r--morphlib/plugins/build_plugin.py23
1 files changed, 23 insertions, 0 deletions
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