Exemplo n.º 1
0
 def parameters(self):
     param_elements = PossiblyMissingElement(self.element).possibly_missing_child("params").findall("param")
     result = {}
     for param_element in param_elements:
         result[param_element.attrib['name']] = param_element.text
     return result
Exemplo n.º 2
0
 def without_any_parameters(self):
     PossiblyMissingElement(self.element).possibly_missing_child("params").remove_all_children()
     return self
Exemplo n.º 3
0
 def tabs(self):
     return [Tab(e.attrib['name'], e.attrib['path']) for e in PossiblyMissingElement(self.element).possibly_missing_child('tabs').findall('tab')]
Exemplo n.º 4
0
 def set_git_material(self, git_material):
     if len(self.git_materials) > 1:
         raise RuntimeError('Cannot set git url for pipeline that already has multiple git materials. Use "ensure_material(GitMaterial(..." instead')
     PossiblyMissingElement(self.element).possibly_missing_child('materials').remove_all_children('git')
     self.__add_material(git_material)
     return self
Exemplo n.º 5
0
 def agents(self):
     return [
         Agent(e) for e in PossiblyMissingElement(self.__xml_root).
         possibly_missing_child('agents').findall('agent')
     ]
Exemplo n.º 6
0
 def make_empty(self):
     PossiblyMissingElement(self.element).remove_all_children()
Exemplo n.º 7
0
 def fetch_materials(self):
     return not PossiblyMissingElement(self.element).has_attribute("fetchMaterials", "false")
Exemplo n.º 8
0
 def remove_materials(self):
     PossiblyMissingElement(self.element).remove_all_children('materials')
Exemplo n.º 9
0
 def clean_working_dir(self):
     return PossiblyMissingElement(self.element).has_attribute('cleanWorkingDir', "true")
Exemplo n.º 10
0
 def has_manual_approval(self):
     return PossiblyMissingElement(self.element).possibly_missing_child("approval").has_attribute("type", "manual")
Exemplo n.º 11
0
 def jobs(self):
     job_elements = PossiblyMissingElement(self.element).possibly_missing_child('jobs').findall('job')
     return [Job(job_element, self) for job_element in job_elements]
Exemplo n.º 12
0
 def without_any_tasks(self):
     PossiblyMissingElement(self.element).possibly_missing_child("tasks").remove_all_children()
     return self
Exemplo n.º 13
0
 def tasks(self):
     return [Task(e) for e in PossiblyMissingElement(self.element).possibly_missing_child("tasks").iterator]
Exemplo n.º 14
0
 def remove_timer(self):
     PossiblyMissingElement(self.element).remove_all_children('timer')
     return self
Exemplo n.º 15
0
 def _approval_authorization(self):
     return PossiblyMissingElement(self.element).possibly_missing_child('approval').possibly_missing_child('authorization')
Exemplo n.º 16
0
 def make_empty(self):
     PossiblyMissingElement(self.element).remove_all_children().remove_attribute('labeltemplate')
Exemplo n.º 17
0
 def fetch_materials(self, value):
     if value:
         PossiblyMissingElement(self.element).remove_attribute("fetchMaterials")
     else:
         Ensurance(self.element).set("fetchMaterials", "false")
Exemplo n.º 18
0
 def repositories(self):
     return [
         Repository(e) for e in PossiblyMissingElement(self.__xml_root).
         possibly_missing_child('repositories').findall('repository')
     ]
Exemplo n.º 19
0
 def materials(self):
     elements = PossiblyMissingElement(self.element).possibly_missing_child('materials').iterator
     return [Materials(element) for element in elements]
Exemplo n.º 20
0
 def templates(self):
     return [
         Pipeline(e, 'templates')
         for e in PossiblyMissingElement(self.__xml_root).
         possibly_missing_child('templates').findall('pipeline')
     ]
Exemplo n.º 21
0
 def set_package_material(self, package_material):
     if len(self.package_materials) > 1:
         raise RuntimeError('Cannot set package ref for pipeline that already has multiple package materials. Use "ensure_material(PackageMaterial(..." instead')
     PossiblyMissingElement(self.element).possibly_missing_child('materials').remove_all_children('package')
     self.__add_material(package_material)
     return self
Exemplo n.º 22
0
 def __possibly_missing_server_element(self):
     return PossiblyMissingElement(
         self.__xml_root).possibly_missing_child('server')
Exemplo n.º 23
0
 def artifacts(self):
     artifact_elements = PossiblyMissingElement(self.element).possibly_missing_child("artifacts").iterator
     return set([Artifact.get_artifact_for(e) for e in artifact_elements])