当前位置:网站首页>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
边栏推荐
- 迅为-iMX6ULL开发板上配置AP热点
- 如何使用甘特图图层和筛选器
- Introduction to Huawei cloud micro certification examination
- 如何创建交互式内核密度图表
- 插件Bilibili新版0.5.5
- The first choice for lightweight GPU applications is the NVIDIA vgpu instance launched by Jingdong Zhilian cloud
- VARCHART XGantt如何在日历上表示工作日
- The isolation level of transaction and its problems
- Google browser realizes video playback acceleration function
- Nonvolatile MRAM memory used in all levels of cache
猜你喜欢
大佬们如何在nginx镜像里面增加模块?
迅为iMX6开发板-设备树内核-menuconfig的使用
JVM memory allocation - xms128m - xmx512m - XX: permsize = 128M - XX: maxpermsize = 512M
How to add modules to nginx image?
Mongo user rights login instruction
Empty test suite appears in JUnit test
测试攻城狮必备技能点!一文带你解读DevOps下的测试技术
JVM class loading mechanism
Introduction to Huawei cloud micro certification examination
2020-08-29: process thread differences, in addition to the inclusion relationship, the underlying details?
随机推荐
关于DevOps的七大误解,99%的人都曾中过招!
Utility class functions (continuous update)
Two dimensional code location and alarm system of Expressway
STM32F030F4P6兼容灵动微MM32F031F4P6
Web API interface design: swaggerui document / unified response format / unified exception handling / unified authority verification
小程序商城系统插件代码该如何写?怎么用代码检查添加插件是否成功?
Python 100 cases
南京标志设计,logo设计公司
南京标识标牌设计制作,导视VI系统设计
10000! Ideal car recalls all defective cars: 97 accidents have occurred and losses will be expanded
非易失性MRAM存储器应用于各级高速缓存
Benefits and functions of auto maintenance app development
September 9, 2020: naked writing algorithm: two threads print numbers 1-100 in turn.
打工人好物——磨炼钢铁意志就要这样高效的电脑
Epu360: all the H5 templates you want are here, e-book, big turntable, red envelope rain, questionnaire survey
All the way, I was forced to talk about C code debugging skills and remote debugging
Experiment one
实验一
Design of NAND flash interface control
Reserved battery interface, built-in charge and discharge circuit and electricity meter, quickly help easily handle hand-held applications