当前位置:网站首页>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
边栏推荐
- Characteristics of magnetic memory chip STT-MRAM
- MRAM高速缓存的组成
- C language I blog assignment 03
- Stm32f030f4p6 compatible with smart micro mm32f031f4p6
- Gantt chart grouping activities tutorial
- JS string - string string object method
- 测试攻城狮必备技能点!一文带你解读DevOps下的测试技术
- Git remote library rollback specified version
- 大佬们如何在nginx镜像里面增加模块?
- FreeSWITCH视频会议“标准”解决方案
猜你喜欢
2020-08-15:什么情况下数据任务需要优化?
LEADTOOLS如何检测,读取和写入条形码
打工人好物——磨炼钢铁意志就要这样高效的电脑
2020-08-17: how to solve data skew in detail?
WebAPI接口设计:SwaggerUI文档 / 统一响应格式 / 统一异常处理 / 统一权限验证
迅为-iMX6ULL开发板上配置AP热点
Jenkins入门(二)声明式流水线Jenkins Pipeline
Summary of common SQL statements
Google browser realizes video playback acceleration function
August 18, 2020: introduce Mr process?
随机推荐
2020-08-17: how to solve data skew in detail?
MRAM高速缓存的组成
【涂鸦物联网足迹】物联网基础介绍篇
A good thing for working people -- to temper the will of iron and steel requires such an efficient computer
20个XR项目路演,近20个资本机构出席!诚邀您参加2020 Qualcomm XR生态合作伙伴大会
20 XR projects roadshows, nearly 20 capital institutions attended! We sincerely invite you to attend the 2020 qcomm XR eco Partner Conference
轻量型 GPU 应用首选 京东智联云推出 NVIDIA vGPU 实例
The first choice for lightweight GPU applications is the NVIDIA vgpu instance launched by Jingdong Zhilian cloud
Nonvolatile MRAM memory used in all levels of cache
小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
LEADTOOLS如何检测,读取和写入条形码
高速公路二维码定位报警系统
[elastic search engine]
Unexpected element.. required element
Plug in bilibilibili new version 0.5.5
Win7 AppCrash (solution)
Qt音视频开发46-视频传输UDP版
条形码识别性能低,如何优化Dynamsoft Barcode Reader解码性能
Practice of Xiaoxiong school development board: real equipment access of smart street lamp sandbox experiment
C and C / C + + mixed programming series 5 - GC collaboration of memory management