pyjen.build module

Primitives for interacting with Jenkins builds

class pyjen.build.Build(api)[source]

Bases: object

information about a single build / run of a Job

Builds are executions of jobs and thus instances of this class are typically generated from the Job class.

See also

Job

Parameters

api (/utils/jenkins_api/JenkinsAPI) – Pre-initialized connection to the Jenkins REST API

abort()[source]

Aborts this build before it completes

artifact_urls

list of 0 or more URLs to download published build artifacts

Return type

list of str

changeset

Gets the list of SCM changes associated with this build

Returns

0 or more SCM changesets associated with / included in this build.

Return type

Changeset

console_output

Gets the raw console output for this build as plain text

Returns

Raw console output from this build, in plain text format

Return type

str

description

Gets the descriptive text associated with this build.

May be an empty string if no description given.

Return type

str

duration

Total runtime of the build, in milliseconds

Returns 0 if build hasn’t finished

Return type

int

estimated_duration

Estimated runtime for a running build

Estimate is based off average duration of previous builds, in milliseconds

Return type

int

is_building

Checks to see whether this build is currently executing

Returns

True if the build is executing otherwise False

Return type

bool

kill()[source]

Performs hard kill on this build

number

Gets the sequence number of this build

Returns

sequentially assigned integer value associated with this build

Return type

int

result

Gets the status of the build

Returns

Result state of the associated job upon completion of this build. Typically one of the following:

  • ”SUCCESS”

  • ”UNSTABLE”

  • ”FAILURE”

  • ”ABORTED”

Return type

str

start_time

Gets the time stamp of when this build was started

Returns

the date and time at which this build was started

Return type

datetime.datetime

uid

Gets the unique identifier associated with this build

Return type

str

url

Gets the URL of this build

Returns

full url to this build

Return type

str