Asynchronous library of Jenkins API based on aiohttp
Project description
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 using aiojenkins.Jenkins as an async context manager (preferred):
import asyncio
import aiojenkins
async def example():
async with aiojenkins.Jenkins('http://your_server/jenkins', 'user', 'password') as jenkins:
await jenkins.builds.start('job_name', {'parameter': 'test'})
asyncio.run(example())
Or without an async context manager:
import asyncio
import aiojenkins
jenkins = aiojenkins.Jenkins('http://your_server/jenkins', 'user', 'password')
async def example():
try:
await jenkins.builds.start('job_name', {'parameter': 'test'})
finally:
jenkins.close()
asyncio.run(example())
Documentation
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aiojenkins-0.8.0.tar.gz
(19.2 kB
view details)
Built Distribution
File details
Details for the file aiojenkins-0.8.0.tar.gz
.
File metadata
- Download URL: aiojenkins-0.8.0.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60212858893a20cfada9e58618094714d67eb3459e9a9bfd0adbdbe12fc254a3 |
|
MD5 | 5480d14cf5eb2b99f029e19cb311b5ac |
|
BLAKE2b-256 | f7cca7c07c5b9d0af29ffd873106700632eef4a7dee3f3459bfc0fefc7f748ce |
File details
Details for the file aiojenkins-0.8.0-py3-none-any.whl
.
File metadata
- Download URL: aiojenkins-0.8.0-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45f33827fd2b0fbb4d2dc30ccec8051ee6565a8e5fb1da71e98420c76fd6e626 |
|
MD5 | 0fccf341f56ecbbd254f70e97d6c537b |
|
BLAKE2b-256 | 63ea59fdbad5f6e2154c3fe343f910bf9966498dd648ada30f97251ac5ebe6e1 |