stevemuskiewicz / ujenkins

Python client for Jenkins (sync + async)

Home Page:https://ujenkins.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Universal Python client for Jenkins


Python client for Jenkins which supports both sync and async syntax with same interface.

+--------------------------------------------+ | Comparison to other packages | +-------------------+-------+-------+--------+ | Name | Sync | Async | Python | +===================+=======+=======+========+ | ujenkins | YES | YES | 3.6+ | +-------------------+-------+-------+--------+ | aiojenkins | NO | YES | 3.5+ | +-------------------+-------+-------+--------+ | python-jenkins | YES | NO | 3.4+ | +-------------------+-------+-------+--------+ | jenkinsapi | YES | NO | 3.4+ | +-------------------+-------+-------+--------+

Installation

Latest release from PyPI

pip3 install ujenkins

Or latest developing version

pip3 install git+https://github.com/pbelskiy/ujenkins

Usage

Get Jenkins version using sync client:

With async client (be careful AsyncJenkinsClient must be called inside async function):

Examples

In all code examples below client instance is created by:

Get timestamp of latest build

Get url of started build

Be careful, JenkinsNotFoundError could be raise in case build with same arg already enqueued.

Get all jobs

Basically client.jobs.get() returns jobs from root (depth = 0), in case you want receive all the jobs, there are few approaches for it.

  1. Set needed depth, experimentally 10 is enough.

Output:

  1. Or just write your code to recursively form it, example is below.

Working with build artifacts

Documentation

Read the Docs

Testing

Prerequisites: tox

Then just run tox, all dependencies and checks will run automatically

tox

Contributing

Any contributions are welcome!

About

Python client for Jenkins (sync + async)

https://ujenkins.readthedocs.io

License:MIT License


Languages

Language:Python 100.0%