当前位置:网站首页>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-20: the difference between go and python?
- Introduction to Huawei cloud micro certification examination
- The method of local search port number occupation in Windows system
- Configuration of AP hotspot on xunwei-imx6ull development board
- What grammar is it? ]
- The role of theme music in games
- Js字符串-String字符串对象方法
- Hdu3974 assign the task segment tree DFS order
- Web API interface design: swaggerui document / unified response format / unified exception handling / unified authority verification
- [doodling the footprints of Internet of things] Introduction to Internet of things
猜你喜欢

Es create a new index database and copy the old index library, practice pro test effective!

JS array the usage of array is all here (array method reconstruction, array traversal, array de duplication, array judgment and conversion)

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

2020-08-14:数据任务的执行引擎用的哪些?

August 24, 2020: what are small documents? What's wrong with a lot of small files? How to solve many small files? (big data)

磁存储芯片STT-MRAM的特点

2020-08-19: what mechanism does TCP ensure reliability?

Jenkins installation and deployment process

图像处理工具包ImagXpress使用教程,如何查看事件

LEADTOOLS如何检测,读取和写入条形码
随机推荐
[graffiti Internet of things footprints] panoramic introduction of graffiti cloud platform
20 XR projects roadshows, nearly 20 capital institutions attended! We sincerely invite you to attend the 2020 qcomm XR eco Partner Conference
Using JSON webtoken (JWT) to generate token in nodejs
WebAPI接口设计:SwaggerUI文档 / 统一响应格式 / 统一异常处理 / 统一权限验证
条形码识别器Dynamsoft Barcode Reader v7.5全新上线!
Nonvolatile MRAM memory used in all levels of cache
2020年新规,微信封号怎么快速解除?
【涂鸦物联网足迹】物联网基础介绍篇
ImageMagick - add watermark
【涂鸦物联网足迹】涂鸦云平台全景介绍
STM32F030F4P6兼容灵动微MM32F031F4P6
Event monitoring problem
预留电池接口,内置充放电电路及电量计,迅为助力轻松搞定手持应用
How to add modules to nginx image?
How to make characters move
Jenkins入门(二)声明式流水线Jenkins Pipeline
[byte jumps, autumn recruitment Posts open] ohayoo! Don't leave after school, I want to ask you to play games!!!
汽车维修app开发的好处与功能
迅为-iMX6ULL开发板上配置AP热点
Configuration of AP hotspot on xunwei-imx6ull development board