From d91a916069b6a0acfbee21ce26e68633fa667258 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 30 Jul 2014 15:07:59 +0100 Subject: =?UTF-8?q?Allow=20release=20deployments=20with=20system=20name=20?= =?UTF-8?q?=E2=89=A0=20deployment=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There used to be a check that prevented deployments with names different to the system. I don't know why this was, but I don't think we need it. --- scripts/release-build | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) (limited to 'scripts') diff --git a/scripts/release-build b/scripts/release-build index fe10ba3b..7713aab8 100755 --- a/scripts/release-build +++ b/scripts/release-build @@ -131,32 +131,29 @@ class ReleaseApp(cliapp.Application): outputs = {} for system in cluster['systems']: - name = system['morph'] - morphology = self.load_morphology(name)[0] + morphology_name = system['morph'] + morphology = self.load_morphology(morphology_name)[0] if morphology['arch'] not in self.controllers: continue - if name not in system['deploy']: - raise cliapp.AppException( - 'In %s: system %s ID should be "%s"' % - (cluster_path, name, name)) - - # The release.morph cluster must specify a basename for the file, - # of name and extension. This script knows about name, but it - # can't find out the appropriate file extension without second - # guessing the behaviour of write extensions. - basename = system['deploy'][name]['location'] - - if '/' in basename or basename.startswith(version_label): - raise cliapp.AppException( - 'In %s: system %s.location should be just the base name, ' - 'e.g. "%s.img"' % (cluster_path, name, name)) - - filename = os.path.join('release', '%s-%s' % (version_label, basename)) - if os.path.exists(filename): - self.output.write('Reusing existing deployment of %s\n' % filename) - else: - self.output.write('Creating %s from release.morph\n' % filename) - self.deploy_single_image(cluster_path, name, filename, version_label) + + for deployment_name, deployment_info in system['deploy'].iteritems(): + # The release.morph cluster must specify a basename for the file, + # of name and extension. This script knows about name, but it + # can't find out the appropriate file extension without second + # guessing the behaviour of write extensions. + basename = deployment_info['location'] + + if '/' in basename or basename.startswith(version_label): + raise cliapp.AppException( + 'In %s: system %s.location should be just the base name, ' + 'e.g. "%s.img"' % (cluster_path, deployment_name, deployment_name)) + + filename = os.path.join('release', '%s-%s' % (version_label, basename)) + if os.path.exists(filename): + self.output.write('Reusing existing deployment of %s\n' % filename) + else: + self.output.write('Creating %s from release.morph\n' % filename) + self.deploy_single_image(cluster_path, deployment_name, filename, version_label) def deploy_single_image(self, cluster_path, name, location, version_label): deploy_command = [ -- cgit v1.2.1