summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-08-14 14:51:28 (GMT)
committerBaserock Gerrit <gerrit@baserock.org>2015-08-19 18:04:29 (GMT)
commit6cb63998328664c5c234b5a5da7ea3a9026e4d2a (patch)
tree04e70e0db49aa0099bbbbdfe78e0ec31b4c1f9eb
parent89f26acce386a01a7b8a88c628d22e1b3860b65d (diff)
downloaddefinitions-baserock/release/baserock-15.34.tar.gz
scripts: Fix release-build to not depend on a system branchbaserock-15.34baserock/release/baserock-15.34
Signed-off-by: Sam Thursfield <sam.thursfield@codethink.co.uk> Change-Id: I1c8d2ed5d9c06466bdaac1c1e914f5f9e3969e11
-rwxr-xr-xscripts/release-build19
1 files changed, 16 insertions, 3 deletions
diff --git a/scripts/release-build b/scripts/release-build
index 5525e9e..4544dd4 100755
--- a/scripts/release-build
+++ b/scripts/release-build
@@ -60,6 +60,18 @@ class ReleaseApp(cliapp.Application):
'Baserock version of the systems being built',
default='yy.ww')
+ def error(self, message):
+ raise cliapp.AppException(message)
+
+ def check_args(self, args):
+ if len(args) == 0:
+ self.error(
+ "Please pass the name of the release cluster (e.g. "
+ "clusters/release.morph)")
+
+ if len(args) > 1:
+ self.error("Too many arguments given.")
+
def process_args(self, args):
'''Process the command line'''
self.controllers = {}
@@ -70,12 +82,13 @@ class ReleaseApp(cliapp.Application):
self.ref = cliapp.runcmd(['git', 'rev-parse', 'HEAD']).strip()
- sb = morphlib.sysbranchdir.open_from_within('.')
- definitions = sb.get_git_directory_name(sb.root_repository_url)
- defs_repo = morphlib.gitdir.GitDirectory(definitions)
+ defs_repo = morphlib.definitions_repo.open(
+ '.', search_for_root=True, search_workspace=True)
self.loader = morphlib.morphloader.MorphologyLoader()
self.finder = morphlib.morphologyfinder.MorphologyFinder(defs_repo)
+ self.check_args(args)
+
cluster_name = args[0]
cluster, cluster_path = self.load_morphology(cluster_name)