当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Empty test suite appears in JUnit test
- 应用层软件开发教父教你如何重构,资深程序员必备专业技能
- VARCHART XGantt入门教程
- Big data processing black Technology: revealing the parallel computing technology of Pb level data warehouse gaussdb (DWS)
- FreeSWITCH视频会议“标准”解决方案
- Stm32f030k6t6 compatible replacement smart mm32f031k6t6
- Js数组-数组的用法全在这里(数组方法的重构、数组的遍历、数组的去重,数组的判断与转换)
- Application layer software development Godfather teaches you how to refactor, senior programmers must professional skills
- What are the highlights of Huawei mate 40 series with HMS?
- Mongo user rights login instruction
猜你喜欢
New features of vue3
How to start the hidden preferences in coda 2 on the terminal?
【涂鸦物联网足迹】物联网基础介绍篇
消防器材RFID固定资产管理系统
How does varhart xgantt represent working days on a calendar
移动端像素适配方案
Stm32f030f4p6 compatible with smart micro mm32f031f4p6
Nanjing logo design and production, guide VI system design
Stm32f030k6t6 compatible replacement smart mm32f031k6t6
2020-08-15: under what circumstances should data tasks be optimized?
随机推荐
Detailed software engineering -- the necessary graphs in each stage
How to write plug-in code of small program mall system? How to use code to check whether the plug-in is successfully added?
FreeSWITCH视频会议“标准”解决方案
PHP后门隐藏技巧
The first choice for lightweight GPU applications is the NVIDIA vgpu instance launched by Jingdong Zhilian cloud
2020年新规,微信封号怎么快速解除?
image operating system windows cannot be used on this platform
甘特图对活动进行分组教程
STM32F030F4P6兼容灵动微MM32F031F4P6
磁存储芯片STT-MRAM的特点
Epu360: all the H5 templates you want are here, e-book, big turntable, red envelope rain, questionnaire survey
RFID fixed assets management system for fire equipment
Zhou Jie: database system of East China Normal University
2020-08-17: how to solve data skew in detail?
上海巨微专用蓝牙广播芯片
The use of Xunwei imx6 development board device tree kernel menuconfig
jenkins pipline stage 设置超时
JS array the usage of array is all here (array method reconstruction, array traversal, array de duplication, array judgment and conversion)
Novice guidance and event management system in game development
Gantt chart grouping activities tutorial