使用Python的Jenkins API是一个用于与Jenkins CI(持续集成)服务器进行交互的Python库。它提供了一组功能丰富的方法和类,使开发人员能够通过Python脚本自动化Jenkins的各种操作。 Jenkins是一个开源的自动化服务器,用于构建、测试和部署软件项目。它支持各种编程语言和工具,并提供了丰富的插件生态系统
1、jenkins base url的api对比 左侧的为:http://server:port/jenkins/api/python?pretty=true 右侧的为:http://server:port/jenkins/api/json?pretty=true 2、jenkins job的api对比 左侧的为:http://server:port/jenkins/job/JOB_NAME/api/python?pretty=true 右侧的为:http://server:port/jenkins/job/JOB_...
https://python-jenkins.readthedocs.io/en/latest/examples.html 1.2 安装 pip install python-jenkins 2.初级代码 2.1 连接 jenkins服务 import jenkins jenkins_url= 'http://127.0.0.1:6000/' jenkins_server = jenkins.Jenkins(jenkins_url, username="admin", password="admin123") #连接url print(jenkins_...
Jenkins-API使用(python) 环境配置 jenkinsapi、python-jenkins、pbr、multi-key-dict API参考 https://blog.csdn.net/seeeees https://python-jenkins.readthedocs.io/en/latest/api.html class jenkins.Jenkins(server_url,username,password) get_job_info(name, depth=0, fetch_all_builds=False) #获取job的...
一、python-jenkins模块 1.1、安装 pip install python-jenkins 1.2、相关文档 # 官方文档:https://python-jenkins.readthedocs.io/en/latest/ # 官方API: https://python-jenkins.readthedocs.io/en/latest/api.html 1.3、相关方法 importjenkins server = jenkins.Jenkins('http://10.0.0.102:8888/', username=...
sudo pip install python-jenkins 2. 进入python命令环境或创建新的.py文件jenkinsApiTest.py import jenkins #定义远程的jenkins master server的url,以及port jenkins_server_url='xxxx:xxxx' #定义用户的User Id 和 API Token,获取方式同上文 user_id='xxxx' ...
每个接口的使用方法:python-jenkins.readthedocs.io 项目操作 我们需要认识一下Jenkins项目的config.xml,大部分API在创建项目的时候会使用xml文件。 首先创建一个项目(任何类型的都可以不必纠结) 然后我们进入$JENKINS_HOME/jobs/目录查看我们这个项目生成的config.xml文件。 builds存放项目的构建信息。 ZeyangdeMacBook-Pr...
一、jenkins Python API 在线文档:https://python-jenkins.readthedocs.io/en/latest/ 项目地址:https://pypi.org/project/python-jenkins/ 1.注意支持的Python版本 目前只支持到3.6 2.简单示例 pip3 install python-jenkins import jenkins server = jenkins.Jenkins('http://192.168.1.129:8080/jenkins', username...
python3 jenkins api操作 一、安装依赖包 pipinstallpython-jenkins 二、常用操作 0、调用jenkins(以下用的server都是这里的环境) import jenkins server= jenkins.Jenkins('http://localhost:8080', username='admin', password='123456') 1、获取版本信息...
sudo pip install python-jenkins 2. 进入python命令环境或创建新的.py文件jenkinsApiTest.py import jenkins #定义远程的jenkins master server的url,以及port jenkins_server_url='xxxx:xxxx' #定义用户的User Id 和 API Token,获取方式同上文 user_id='xxxx' ...