pyjen.plugins.pipelinejob module

Primitives that manage Jenkins job of type ‘pipeline’

class pyjen.plugins.pipelinejob.PipelineJob(api)[source]

Bases: pyjen.job.Job

Jenkins job of type ‘pipeline’

static get_jenkins_plugin_name()[source]

Gets 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

Return type

str

scm

Gets the source code repo where the job config is defined

scm_definition(scm, script_path='Jenkinsfile', lightweight=True)[source]

Defines the Pipeline groovy script used by this job from files stored in a source code repository

Parameters
  • scm – PyJen object defining the source code repository to use

  • script_path (str) – Path within the repository where the groovy script to be run is found. Defaults to ‘Jenkinsfile’ in the root folder

  • lightweight (bool) – Set to True to have the build only check out the Jenkinsfile and no other file from the repository. Set to False to have the build check out the entire repository before running the Jenkinsfile. Defaults to True

script

Gets the groovy script defining this build

Return type

str

script_definition(script, sandbox=True)[source]

Defines the pipeline build using an inline groovy script

Parameters
  • script (str) – Raw Groovy script defining the build process

  • sandbox (bool) – indicates whether the Groovy script can run in the safer ‘sandbox’ environment. Defaults to True.

static template_config_xml()[source]

Gets template XML that can be used to create instances of this class

Return type

str

class pyjen.plugins.pipelinejob.PipelineXML(api)[source]

Bases: pyjen.utils.jobxml.JobXML

Object that manages the config.xml for a pipeline job

scm

Gets the source code repo where the build script is located

scm_definition(scm, script_path, lightweight)[source]

Defines the Pipeline groovy script used by this job from files stored in a source code repository

Parameters
  • scm – PyJen object defining the source code repository to use

  • script_path (str) – Path within the repository where the groovy script to be run is found.

  • lightweight (bool) – Set to True to have the build only check out the Jenkinsfile and no other file from the repository. Set to False to have the build check out the entire repository before running the Jenkinsfile.

script

Gets the groovy script that defines the build process for this job

script_definition(script, sandbox)[source]

Defines the pipeline build using an inline groovy script

Parameters
  • script (str) – Raw Groovy script defining the build process

  • sandbox (bool) – indicates whether the Groovy script can run in the safer ‘sandbox’ environment.

pyjen.plugins.pipelinejob.PluginClass

alias of pyjen.plugins.pipelinejob.PipelineJob