summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2014-08-01 11:49:14 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2014-08-01 11:49:14 +0100
commit4b6fb6f70f41959e13afc0b1d2821aa30e428032 (patch)
treeb2bb5b4ab318fff3a69540b1c8a400ecb9e10b31
parent3b1fdef20b11f3a29e66119c5cbd1b330c3dd265 (diff)
downloaddefinitions-baserock/michaeldrake/release-upload-cluster.tar.gz
Pass cluster morphology to release upload script.baserock/michaeldrake/release-upload-cluster
This makes the release-upload script more versatile.
-rwxr-xr-xscripts/release-upload21
1 files changed, 12 insertions, 9 deletions
diff --git a/scripts/release-upload b/scripts/release-upload
index 0ab6b957..d7ba8705 100755
--- a/scripts/release-upload
+++ b/scripts/release-upload
@@ -157,10 +157,13 @@ class ReleaseUploader(cliapp.Application):
return pwd.getpwuid(uid)[0]
def process_args(self, args):
+ if len(args) != 1:
+ raise cliapp.AppException('Usage: release-upload CLUSTER')
+ cluster_morphology_path = args[0]
self.status(msg='Uploading and publishing Baserock release')
if self.settings['upload-build-artifacts']:
- self.publish_build_artifacts()
+ self.publish_build_artifacts(cluster_morphology_path)
else:
self.status(
msg='Not uploading build artifacts '
@@ -173,9 +176,9 @@ class ReleaseUploader(cliapp.Application):
msg='Not uploading release artifacts '
'(upload-release-artifacts set to false')
- def publish_build_artifacts(self):
+ def publish_build_artifacts(self, cluster_morphology_path):
publisher = BuildArtifactPublisher(self.settings, self.status)
- publisher.publish_build_artifacts()
+ publisher.publish_build_artifacts(cluster_morphology_path)
self.status(msg='Build artifacts have been published')
def publish_release_artifacts(self):
@@ -198,8 +201,8 @@ class BuildArtifactPublisher(object):
self.settings = settings
self.status = status
- def publish_build_artifacts(self):
- artifact_basenames = self.list_build_artifacts_for_release()
+ def publish_build_artifacts(self, cluster_path):
+ artifact_basenames = self.list_build_artifacts_for_release(cluster_path)
self.status(
msg='Found {count} build artifact files in release',
count=len(artifact_basenames))
@@ -218,7 +221,7 @@ class BuildArtifactPublisher(object):
self.upload_build_artifacts_to_public_trove(to_be_uploaded)
- def list_build_artifacts_for_release(self):
+ def list_build_artifacts_for_release(self, cluster_morphology_path):
self.status(msg='Find build artifacts included in release')
# FIXME: These are hardcoded for simplicity. They would be
@@ -228,7 +231,7 @@ class BuildArtifactPublisher(object):
ref = 'HEAD'
argv = [self.settings['morph-cmd'], 'list-artifacts', '--quiet', repo, ref]
- argv += self.find_system_morphologies()
+ argv += self.find_system_morphologies(cluster_morphology_path)
output = cliapp.runcmd(argv)
basenames = output.splitlines()
logging.debug('List of build artifacts in release:')
@@ -238,8 +241,8 @@ class BuildArtifactPublisher(object):
return basenames
- def find_system_morphologies(self):
- cluster = self.load_cluster_morphology('release.morph')
+ def find_system_morphologies(self, cluster_morphology_path):
+ cluster = self.load_cluster_morphology(cluster_morphology_path)
system_dicts = self.find_systems_in_parsed_cluster_morphology(cluster)
if self.settings['arch']:
system_dicts = self.choose_systems_for_wanted_architectures(