python jenkins-api
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python jenkins-api相关的知识,希望对你有一定的参考价值。
jenkins email server;
sudo pip install python-jenkins
http://python-jenkins.readthedocs.io/en/latest/api.html
import jenkins
jenkins_server_url=‘http://129.0.1.220:8080/jenkins‘
server=jenkins.Jenkins(jenkins_server_url, username=user_id,
password=api_token)
user_id=‘liulq‘
api_token =‘63e55d99366021e726948d8db54ba7999‘
jobInfo = server.get_job_info("ShuiSL")
print jobInfo[‘property‘]
buildInfo = server.get_build_info("UexerciseMVN--TestEnv",153)
print buildInfo[‘changeSet‘]
print buildInfo[‘changeSet‘][‘items‘][21][‘comment‘]
for item in buildInfo[‘changeSet‘][‘items‘]:
print item["comment"]
GIT_COMMIT ,
GIT_BRANCH,
GIT_PREVIOUS_COMMIT,
以上是关于python jenkins-api的主要内容,如果未能解决你的问题,请参考以下文章