summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Holland <william.holland@codethink.co.uk>2015-09-23 12:24:26 +0100
committerWill Holland <william.holland@codethink.co.uk>2015-09-23 12:24:26 +0100
commit79a8374fa8bdb2b94777089c110f27872228b099 (patch)
tree61bbc755ebaa2bb7c97d32b5c0a88f1f3128ebaf
parentc47914485e4eca6e1dda6f9702fda49e65ef750c (diff)
downloadciatlib-79a8374fa8bdb2b94777089c110f27872228b099.tar.gz
Fix refs
-rw-r--r--ciatlib/master.py25
1 files changed, 9 insertions, 16 deletions
diff --git a/ciatlib/master.py b/ciatlib/master.py
index 99a99f7..7997486 100644
--- a/ciatlib/master.py
+++ b/ciatlib/master.py
@@ -7,26 +7,18 @@ Git = steps.Git
class GitSource:
def __init__(self,urls,ref,sha=""):
- ''' Specify a source by a list of urls and a ref and optionally a SHA
- '''
- if type(urls) is list:
- self.urls = urls
- elif type(urls) is str:
- self.urls = [urls]
- else:
- error_msg = 'GitSource requires either a url as a string or a list of url strings'
- raise TypeError(error_msg)
+ ''' Specify a source by a url and a ref. Optionally a SHA '''
+ self.url = url
self.ref = ref
self.sha = sha
class Column:
- def add_get_definitions(self):
+ def add_get_definitions(self,ref):
''' add a step fetch definitions '''
- default_ref = "cu010-trove/br6/firehose-test-1"
- sha = Property("sha",default=default_ref)
- get_defns_cmd = ['sh','get_definitions.sh',sha]
+ ref = Property("ref",default=ref)
+ get_defns_cmd = ['sh','get_definitions.sh',ref]
shell_cmd = ShellCommand(command=get_defns_cmd,
timeout=self.timeout)
self.factory.addStep(shell_cmd)
@@ -54,7 +46,7 @@ class Column:
timeout=1200,
get_definitions=False):
''' A worker in CIAT Orchestration which appears as a column in the
- buildbot waterfall '''
+ buildbot waterfall. get_definitions is either False or a ref '''
self.name = name
assert isinstance(source_repo,GitSource)
@@ -67,9 +59,10 @@ class Column:
self.get_definitions = get_definitions
self.factory = BuildFactory()
self.factory.addStep(Git(
- repourl=self.source_repo,
+ repourl=self.source_repo.url,
+ branch=self.source_repo.ref
mode='incremental'))
if self.get_definitions:
- self.add_get_definitions()
+ self.add_get_definitions(get_definitions)
self.cmd = self.format_cmd()
self.factory.addStep(self.cmd)