def publisher(self): """Retrieves the action to be performed when the conditions of this publisher are met :returns: list of PyJen objects which control each conditional action to be performed :rtype: :class:`list` of PyJen objects, typically one or more plugins supported by the Flexible Publish plugin Return None if an publisher plugin not currently supported by PyJen is being used """ node = self._root.find("publisher") plugin = create_xml_plugin(node) if plugin is None: self._log.warning("Publisher plugin %s referenced by Flexible Publisher not found", get_plugin_name(node)) return plugin
def publishers(self): """Gets a list of 0 or more post-build publisher objects associated with this job :returns: a list of post-build publishers associated with this job :rtype: :class:`list` of publisher plugins supported by this job """ retval = [] nodes = self._root.find('publishers') for node in nodes: plugin = create_xml_plugin(node) if plugin is not None: retval.append(plugin) else: self._log.warning("Unsupported job 'publisher' plugin: " + get_plugin_name(node)) return retval
def properties(self): """Gets a list of 0 or more Jenkins properties associated with this job :returns: a list of customizable properties associated with this job :rtype: :class:`list` of property plugins supported by this job """ retval = [] nodes = self._root.find('properties') for node in nodes: plugin = create_xml_plugin(node) if plugin is not None: retval.append(plugin) else: self._log.warning("Unsupported job 'property' plugin: " + get_plugin_name(node)) return retval
def sections(self): """ :returns: a list of all 'section' objects contained in this view :rtype: :class:`list` of section plugins associated with this view """ nodes = self._root.find('sections') retval = [] for node in nodes: plugin = create_xml_plugin(node) if plugin is not None: retval.append(plugin) else: self._log.warning("Sectioned view plugin %s not found", get_plugin_name(node)) return retval
def actions(self): """Gets the list of publishers associated with this instance of the flexible publisher :returns: list of publishers associated with this instance of the flexible publisher :rtype: :class:`list` of Flexible Publish publishers such as :class:`ConditionalPublisher` """ nodes = self._root.find("publishers") retval = [] for node in nodes: plugin = create_xml_plugin(node) if plugin is not None: retval.append(plugin) else: self._log.warning("Flexible publisher plugin %s not found", get_plugin_name(node)) return retval
def builders(self): """Gets a list of the build operators that will be executed if the conditions on this builder are satisfied :returns: list of build operators :rtype: :class:`list` of PyJen plugins that support the Jenkins builder operations """ nodes = self._root.find("conditionalbuilders") retval = [] for node in nodes: plugin = create_xml_plugin(node) if plugin is not None: retval.append(plugin) else: self._log.warning("Builder plugin %s used by conditional builder not found", get_plugin_name(node)) return retval
def entries(self): """Gets the list of deployment options associated with this plugin :returns: list of configuration options for each set of artifacts managed by this instance :rtype: :class:`list` of :class:`ArtifactDeployerEntry` objects """ nodes = self._root.find("entries") retval = [] for node in nodes: plugin = create_xml_plugin(node) if plugin is not None: retval.append(plugin) else: raise PluginNotSupportedError("Artifact deployer configuration plugin {0} not found".format( get_plugin_name(node)), get_plugin_name(node)) return retval
def scm(self): """Retrieves the appropriate plugin for the SCM portion of a job Detects which source code management tool is being used by this job, locates the appropriate plugin for that tool, and returns an instance of the wrapper for that plugin pre-configured with the settings found in the relevant XML subtree. :returns: One of any number of plugin objects responsible for providing extensions to the source code management portion of a job Examples: :class:`~pyjen.plugins.subversion.Subversion` :rtype: :class:`~.pluginapi.PluginBase` """ node = self._root.find('scm') plugin = create_xml_plugin(node) if plugin is not None: return plugin raise PluginNotSupportedError("Job XML plugin {0} not found".format(get_plugin_name(node)), get_plugin_name(node))