当前位置:网站首页>Python 3 operates the Jenkins module API
Python 3 operates the Jenkins module API
2020-11-06 22:38:00 【Leaf blade】
#coding=utf-8
import json
from time import sleep
import jenkins
# Set up jenkins Connection timeout 5 second
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=(',', ':')))
版权声明
本文为[Leaf blade]所创,转载请带上原文链接,感谢
边栏推荐
- 20 XR projects roadshows, nearly 20 capital institutions attended! We sincerely invite you to attend the 2020 qcomm XR eco Partner Conference
- 图像处理工具包ImagXpress使用教程,如何查看事件
- 2020-08-14:数据任务的执行引擎用的哪些?
- 【涂鸦物联网足迹】物联网基础介绍篇
- 插件Bilibili新版0.5.5
- Stickinengine architecture 11 message queue
- Utility class functions (continuous update)
- [learning] interface test case writing and testing concerns
- Application of UHF RFID medical blood management system
- Mobile pixel adaptation scheme
猜你喜欢

The use of Xunwei imx6 development board device tree kernel menuconfig

Ora-02292: complete constraint violation (midbjdev2.sys_ C0020757) - subrecord found

2020 database technology conference helps technology upgrade

vue3 新特性

Dynamsoft barcode reader v7.5!

Two dimensional code location and alarm system of Expressway

汽车维修app开发的好处与功能

Novice guidance and event management system in game development

How to add modules to nginx image?

Zhou Jie: database system of East China Normal University
随机推荐
图像处理工具包ImagXpress使用教程,如何查看事件
2020年新规,微信封号怎么快速解除?
Dynamsoft barcode reader v7.5!
细数软件工程----各阶段必不可少的那些图
Benefits and functions of auto maintenance app development
How to start the hidden preferences in coda 2 on the terminal?
2020-08-19: what mechanism does TCP ensure reliability?
The memorandum model of behavior model
谈了多年的数字化转型,为什么还有很多企业依然“口头管理”
Method of code refactoring -- Analysis of method refactoring
ado.net and asp.net The relationship between
Erd-online free online database modeling tool
Mongo user rights login instruction
JS string - string string object method
Empty test suite appears in JUnit test
【涂鸦物联网足迹】物联网基础介绍篇
WebAPI接口设计:SwaggerUI文档 / 统一响应格式 / 统一异常处理 / 统一权限验证
PHP后门隐藏技巧
Jenkins入门(二)声明式流水线Jenkins Pipeline
The essence of transaction and the principle of deadlock