当前位置:网站首页>python3操作Jenkins模块api
python3操作Jenkins模块api
2020-11-06 22:38:00 【落叶刀】
#coding=utf-8
import json
from time import sleep
import jenkins
# 设置jenkins连接超时5秒
server = jenkins.Jenkins('http://192.168.xxx.xxx:8088',
username='root',
password='adminadmin',
timeout=5)
jenkins_job = 'ZEP-BACKEND-JAVA'
arg_dic = {
'git_url': 'http://192.168.xxx.xxx/ZEP-BACKEND/ZEP-BACKEND-JAVA.git',
'branch_build': 'master',
'package_name': 'javademo-1.0.jar',
'app_name': 'ZEP-BACKEND-JAVA',
'deploy_version': '2020-1102-2232-24BP',
'dir_build_file': 'javademo',
'zip_package_name': 'javademo-1.0.tar.gz',
}
next_build_number = server.get_job_info(jenkins_job)['nextBuildNumber']
server.build_job(jenkins_job, arg_dic)
print(next_build_number)
sleep(10)
build_info = server.get_build_info(jenkins_job, next_build_number)
print(json.dumps(build_info, sort_keys=True,
indent=4, separators=(',', ':')))
版权声明
本文为[落叶刀]所创,转载请带上原文链接,感谢
https://my.oschina.net/luoyedao/blog/4698417
边栏推荐
- 2020-08-29: process thread differences, in addition to the inclusion relationship, the underlying details?
- The isolation level of transaction and its problems
- 2020-09-04: do you understand the function call convention?
- NAND FLASH的接口控制设计
- Erd-online free online database modeling tool
- Bluetooth broadcast chip for Shanghai giant micro
- How to use Gantt chart layers and filters
- Jenkins installation and deployment process
- Introduction to Huawei cloud micro certification examination
- 20个XR项目路演,近20个资本机构出席!诚邀您参加2020 Qualcomm XR生态合作伙伴大会
猜你喜欢

测试攻城狮必备技能点!一文带你解读DevOps下的测试技术

QT audio and video development 46 video transmission UDP version

Points to be considered when deleting mapping field of index in ES

Design of NAND flash interface control

LEADTOOLS如何检测,读取和写入条形码

Windows 10 Bluetooth management page 'add Bluetooth or other devices' option click no response solution

小熊派开发板实践:智慧路灯沙箱实验之真实设备接入

Stm32f030c6t6 compatible to replace mm32spin05pf

消防器材RFID固定资产管理系统

WebAPI接口设计:SwaggerUI文档 / 统一响应格式 / 统一异常处理 / 统一权限验证
随机推荐
南京标志设计,logo设计公司
RFID fixed assets management system for fire equipment
DC-1 target
[doodling the footprints of Internet of things] Introduction to Internet of things
Introduction to the development of small game cloud
How does varhart xgantt represent working days on a calendar
Git SSH bad permissions
[graffiti Internet of things footprints] panoramic introduction of graffiti cloud platform
The method of local search port number occupation in Windows system
What grammar is it? ]
Count the number of project code lines
[elastic search engine]
打工人好物——磨炼钢铁意志就要这样高效的电脑
Es create a new index database and copy the old index library, practice pro test effective!
August 24, 2020: what are small documents? What's wrong with a lot of small files? How to solve many small files? (big data)
[learning] interface test case writing and testing concerns
Epu360: all the H5 templates you want are here, e-book, big turntable, red envelope rain, questionnaire survey
Empty test suite appears in JUnit test
MRAM高速缓存的组成
Utility class functions (continuous update)