A
A
Alexey M.2015-03-27 13:01:07
Python
Alexey M., 2015-03-27 13:01:07

How to get job fields from Jenkins CI system with Python 3.4 script?

Good afternoon, please tell me, is it possible to pull data from the Jenkins CI system using Python?
You need to get the python 3.4 script for the following fields: build description, build number, date, author, and result (success, failure, cancellation).
3f4d74eeb23c47089cdc085af7606aa1.png
Or maybe someone has a manual on possible commands for working with Jenkins from the outside?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey M., 2015-03-27
@lnl

We managed to solve the problem on our own, thank you all. The most normal API for Jenkins is jenkinsapi. We put
it through

pip install jenkinsapi
or any other way you like.
Code to check:
#Необходимые библиотеки
import jenkinsapi
from jenkinsapi.jenkins import Jenkins
jenkinsci = Jenkins('http://localhost:8080') #путь к Jenkins
print(jenkinsci.version) #Проверяем версию

jenkinsapi library page and documentation .

S
slepowl, 2015-03-27
@slepowl

Is it in html? just log in and parse the page. urllib2\requests and bs4\lxml to help you!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question