当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Stm32f030k6t6 compatible replacement smart mm32f031k6t6
- 应用层软件开发教父教你如何重构,资深程序员必备专业技能
- Experiment one
- The 4th China BIM (digital construction) manager Summit Forum will be held in Hangzhou in 2020
- C calls SendMessage to refresh the taskbar icon (the icon does not disappear at the end of forcing)
- 打工人好物——磨炼钢铁意志就要这样高效的电脑
- 南京标志设计,logo设计公司
- python3操作gitlab
- Markdown tricks
- How to write plug-in code of small program mall system? How to use code to check whether the plug-in is successfully added?
猜你喜欢
大佬们如何在nginx镜像里面增加模块?
非易失性MRAM存储器应用于各级高速缓存
插件Bilibili新版0.5.5
LEADTOOLS如何检测,读取和写入条形码
Unexpected element.. required element
Markdown tricks
Dynamsoft barcode reader v7.5!
Points to be considered when deleting mapping field of index in ES
Method of code refactoring -- Analysis of method refactoring
The 4th China BIM (digital construction) manager Summit Forum will be held in Hangzhou in 2020
随机推荐
Empty test suite appears in JUnit test
ImageMagick - add watermark
Countdown | 2020 PostgreSQL Asia Conference - agenda arrangement of Chinese sub Forum
The Interpreter pattern of behavior pattern
2020-08-19: what mechanism does TCP ensure reliability?
Count the number of project code lines
Utility class functions (continuous update)
2020年新规,微信封号怎么快速解除?
Exclusive interview of guests at | 2020 PostgreSQL Asia Conference: Wang Tao
Nonvolatile MRAM memory used in all levels of cache
小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
JS array the usage of array is all here (array method reconstruction, array traversal, array de duplication, array judgment and conversion)
ado.net and asp.net The relationship between
vue3 新特性
python3操作Jenkins模块api
20 XR projects roadshows, nearly 20 capital institutions attended! We sincerely invite you to attend the 2020 qcomm XR eco Partner Conference
QT audio and video development 46 video transmission UDP version
甘特图对活动进行分组教程
VARCHART XGantt如何在日历上表示工作日
September 9, 2020: naked writing algorithm: two threads print numbers 1-100 in turn.