pyjen.utils.jobxml module

Abstractions for managing the raw config.xml for a Jenkins job

class pyjen.utils.jobxml.JobXML(xml)[source]

Bases: object

Wrapper around the config.xml for a Jenkins job

The source xml can be loaded from nearly any URL by appending “/config.xml” to it, as in “http://server/jobs/job1/config.xml

Parameters:xml (str) – Raw XML character string extracted from a Jenkins job.
XML[source]

Extracts the processed XML for export to a Jenkins job

Returns:Raw XML containing any and all customizations applied in previous operations against this object. This character string can be imported into Jenkins to configure a job.
Return type:str
assigned_node[source]

Gets the build agent label this job is associated with

Returns:the build agent label this job is associated with
Return type:str
builders[source]

Gets a list of 0 or more build operations associated with this job

Returns:a list of build operations associated with this job
Return type:list of builder plugins used by this job
custom_workspace[source]

Gets the local path for the custom workspace associated with this job

Returns:the local path for the custom workspace associated with this job
Return type:str
disable_custom_workspace()[source]

Disables a jobs use of a custom workspace

If the job is not currently using a custom workspace this method will do nothing

properties[source]

Gets a list of 0 or more Jenkins properties associated with this job

Returns:a list of customizable properties associated with this job
Return type:list of property plugins supported by this job
publishers[source]

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
Return type:list of publisher plugins supported by this job
scm[source]

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: Subversion

Return type:PluginBase