Пример #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
Пример #2
0
 def without_any_parameters(self):
     PossiblyMissingElement(self.element).possibly_missing_child("params").remove_all_children()
     return self
Пример #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')]
Пример #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
Пример #5
0
 def agents(self):
     return [
         Agent(e) for e in PossiblyMissingElement(self.__xml_root).
         possibly_missing_child('agents').findall('agent')
     ]
Пример #6
0
 def make_empty(self):
     PossiblyMissingElement(self.element).remove_all_children()
Пример #7
0
 def fetch_materials(self):
     return not PossiblyMissingElement(self.element).has_attribute("fetchMaterials", "false")
Пример #8
0
 def remove_materials(self):
     PossiblyMissingElement(self.element).remove_all_children('materials')
Пример #9
0
 def clean_working_dir(self):
     return PossiblyMissingElement(self.element).has_attribute('cleanWorkingDir', "true")
Пример #10
0
 def has_manual_approval(self):
     return PossiblyMissingElement(self.element).possibly_missing_child("approval").has_attribute("type", "manual")
Пример #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]
Пример #12
0
 def without_any_tasks(self):
     PossiblyMissingElement(self.element).possibly_missing_child("tasks").remove_all_children()
     return self
Пример #13
0
 def tasks(self):
     return [Task(e) for e in PossiblyMissingElement(self.element).possibly_missing_child("tasks").iterator]
Пример #14
0
 def remove_timer(self):
     PossiblyMissingElement(self.element).remove_all_children('timer')
     return self
Пример #15
0
 def _approval_authorization(self):
     return PossiblyMissingElement(self.element).possibly_missing_child('approval').possibly_missing_child('authorization')
Пример #16
0
 def make_empty(self):
     PossiblyMissingElement(self.element).remove_all_children().remove_attribute('labeltemplate')
Пример #17
0
 def fetch_materials(self, value):
     if value:
         PossiblyMissingElement(self.element).remove_attribute("fetchMaterials")
     else:
         Ensurance(self.element).set("fetchMaterials", "false")
Пример #18
0
 def repositories(self):
     return [
         Repository(e) for e in PossiblyMissingElement(self.__xml_root).
         possibly_missing_child('repositories').findall('repository')
     ]
Пример #19
0
 def materials(self):
     elements = PossiblyMissingElement(self.element).possibly_missing_child('materials').iterator
     return [Materials(element) for element in elements]
Пример #20
0
 def templates(self):
     return [
         Pipeline(e, 'templates')
         for e in PossiblyMissingElement(self.__xml_root).
         possibly_missing_child('templates').findall('pipeline')
     ]
Пример #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
Пример #22
0
 def __possibly_missing_server_element(self):
     return PossiblyMissingElement(
         self.__xml_root).possibly_missing_child('server')
Пример #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])