From 20ed314e1ac67c15b5439b35656cd8ee5603441f Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Fri, 18 Sep 2015 17:16:56 +0000 Subject: scripts/release-build: Allow setting controller ports This is useful if you have a distbuild controller with a non-standard port. It now also warns if something couldn't be built because there is no build network for that arch available. Change-Id: I5fcac2be9aa198afe16b76564d8307fed04bd526 --- scripts/release-build | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/release-build b/scripts/release-build index 4544dd41..2dc8c2ff 100755 --- a/scripts/release-build +++ b/scripts/release-build @@ -28,10 +28,17 @@ class Build(object): def __init__(self, name, arch, app): self.system_name = name - self.controller = app.controllers[arch] + + controller_netloc = app.controllers[arch].split(':') + controller_args = [ + '--controller-initiator-address=%s' % controller_netloc[0], + ] + if len(controller_netloc) > 1: + controller_args.append( + '--controller-initiator-port=%s' % controller_netloc[1]) + self.command = [ - 'morph', 'distbuild-morphology', - '--controller-initiator-address=%s' % self.controller, + 'morph', 'distbuild-morphology'] + controller_args + [ 'baserock:baserock/definitions', app.ref, self.system_name] def start(self): @@ -76,8 +83,9 @@ class ReleaseApp(cliapp.Application): '''Process the command line''' self.controllers = {} controllers_list = self.settings['controllers'] + for item in controllers_list: - arch, controller = item.split(':') + arch, controller = item.split(':', 1) self.controllers[arch] = controller self.ref = cliapp.runcmd(['git', 'rev-parse', 'HEAD']).strip() @@ -139,6 +147,9 @@ class ReleaseApp(cliapp.Application): system, _ = self.load_morphology(system_name) if system['arch'] in self.controllers: builds.append(Build(system_name, system['arch'], self)) + else: + print("Unable to build %s: no %s distbuild available" % + (system_name, system['arch'])) return builds def deploy_images(self, cluster, cluster_path): -- cgit v1.2.1