pyjen.plugins.freestylejob module
Primitives that manage Jenkins job of type ‘Freestyle’
- class pyjen.plugins.freestylejob.FreestyleJob(api)[source]
Bases:
pyjen.job.Job
Jenkins job of type ‘freestyle’
- Parameters
api (JenkinsAPI) – Pre-initialized connection to the Jenkins REST API
- add_builder(builder)[source]
Adds a new build step to this job
- Parameters
builder (XMLPlugin) – PyJen plugin describing the build step to add
- add_publisher(publisher)[source]
Adds a new job publisher to this job
- Parameters
publisher (XMLPlugin) – job publisher to add
- property all_downstream_jobs
list of all jobs that depend on this job, recursively
Includes jobs triggered by this job, and all jobs triggered by those jobs, recursively for all downstream dependencies
- property all_upstream_jobs
list of all jobs that this job depends on, recursively
Includes jobs that trigger this job, and all jobs trigger those jobs, recursively for all upstream dependencies
- property assigned_node
the custom node label restricting which nodes this job can run against
- Type
- property builders
PyJen plugins that manage the various ‘builders’ for this job
- property custom_workspace
the custom workspace associated with this job
May return an empty character string if the custom workspace feature is not currently enabled.
- Type
- property custom_workspace_enabled
Checks to see if this job has the custom workspace option enabled
- Type
- static get_jenkins_plugin_name()[source]
str: the name of the Jenkins plugin associated with this PyJen plugin
This static method is used by the PyJen plugin API to associate this class with a specific Jenkins plugin, as it is encoded in the config.xml
- property quiet_period
the delay, in seconds, builds of this job wait in the queue before being run. Returns -1 if there is no custom quiet period for this job
- Type
- property quiet_period_enabled
Checks to see if a custom quiet period is defined on this job
- Type
- property scm
PyJen plugin describing the source code repository configuration for the job
- Type
- class pyjen.plugins.freestylejob.FreestyleXML(api)[source]
Bases:
pyjen.utils.jobxml.JobXML
Abstraction around the config.xml for this type of Jenkins job
- Parameters
api (JenkinsAPI) – Rest API for the Jenkins XML configuration managed by this object
- add_builder(builder)[source]
Adds a new builder node to the build steps section of the job XML
- Parameters
builder (XMLPlugin) – PyJen plugin implementing the new job builder to be added
- add_publisher(new_publisher)[source]
Adds a new publisher node to the publisher section of the job XML
- Parameters
new_publisher (XMLPlugin) – PyJen plugin which supports the Jenkins publisher API
- property builders
PyJen plugins that manage the various ‘builders’ for this job
- property custom_workspace
the local path for the custom workspace associated with this job. Returns None if the custom workspace option is not enabled
- Type
- property publishers
0 or more post-build publishers associated with this job. Each element will be an instance of a compatible PyJen plugin for each publisher. Publishers with no valid PyJen plugin installed will be ignored
- property quiet_period
the delay, in seconds, this job waits in queue before running a build
May return None if no custom quiet period is defined. At the time of this writing the default value is 5 seconds however this may change over time.
- Type
- property scm
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
Example:
Subversion
Example:GitSCM
- Return type
- pyjen.plugins.freestylejob.PluginClass