autojenkins.jobs

class autojenkins.jobs.Jenkins(base_url, auth=None)

Main class to interact with a Jenkins server.

all_jobs()

Get a list of tuples with (name, color) of all jobs in the server.

Color is blue, yellow or red depending on build results (SUCCESS, UNSTABLE or FAILED).

build(jobname, wait=False, grace=10)

Trigger Jenkins to build a job.

Parameters:wait – If True, wait until job completes building before returning
copy(jobname, copy_from='template')

Copy a job from another one (by default from one called template).

create(jobname, config_file, **context)

Create a job from a configuration file.

create_copy(jobname, template_job, enable=True, **context)

Create a job from a template job.

delete(jobname)

Delete a job.

disable(jobname)

Trigger Jenkins to disable a job.

enable(jobname)

Trigger Jenkins to enable a job.

get_config_xml(jobname)

Get the config.xml file that contains the job definition.

is_building(jobname)

Check if a job is building

job_info(jobname)

Get all information for a job as a Python object (dicts & lists).

job_url(jobname)

Get the human-browseable URL for a job.

last_build_info(jobname)

Get information for last build of a job.

last_build_report(jobname)

Get full report of last build.

last_result(jobname)

Obtain results from last execution.

last_success(jobname)

Return information about the last successful build.

set_config_xml(jobname, config)

Replace the config.xml of an existing job.

transfer(jobname, to_server)

Copy a job to another server.

wait_for_build(jobname, poll_interval=3)

Wait until job has finished building

Previous topic

Introduction to AutoJenkins

This Page