Skip to content

Latest commit

 

History

History
84 lines (57 loc) · 2 KB

README.rst

File metadata and controls

84 lines (57 loc) · 2 KB

Async python client for Jenkins

Build Status Docs status Coverage status Version status Downloads status

Asynchronous python package of Jenkins API endpoints based on aiohttp.


Also pay attention to brand new package with same API set but with sync and async interfaces:

https://github.com/pbelskiy/ujenkins

Installation

pip3 install aiojenkins

Usage

Start new build:

import asyncio
import aiojenkins

jenkins = aiojenkins.Jenkins('http://your_server/jenkins', 'user', 'password')

async def example():
    await jenkins.builds.start('job_name', dict(parameter='test'))

loop = asyncio.get_event_loop()
try:
    loop.run_until_complete(example())
finally:
    loop.run_until_complete(jenkins.close())
    loop.close()

Please look at tests directory for more examples.

Documentation

Read the Docs

Testing

Currently tests aren't using any mocking. I am testing locally with dockerized LTS Jenkins ver. 2.222.3

Prerequisites: docker, tox

docker run -d --name jenkins --restart always -p 8080:8080 jenkins/jenkins:lts
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword
chromium http://localhost:8080  # create admin:admin
tox

Contributing

Feel free to PR