当前位置:网站首页>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
边栏推荐
- Introduction to the development of small game cloud
- Code generator plug-in and creator preform file analysis
- 插件Bilibili新版0.5.5
- 迅为iMX6开发板-设备树内核-menuconfig的使用
- To solve the problem that the data interface is not updated after WPF binding set
- What the hell is fastthreadlocal? The existence of ThreadLocal!!
- Method of code refactoring -- Analysis of method refactoring
- Application layer software development Godfather teaches you how to refactor, senior programmers must professional skills
- Design of NAND flash interface control
- Web API interface design: swaggerui document / unified response format / unified exception handling / unified authority verification
猜你喜欢
上海巨微专用蓝牙广播芯片
Stickinengine architecture 12 communication protocol
Nonvolatile MRAM memory used in all levels of cache
“非洲用户的付费意愿并不低”——专访四达时代研发总监张亮
ImageMagick - 添加水印
The advantages and functions of psychological counseling app
Interviewer: how about shardingsphere
Composition of MRAM cache
Zhou Jie: database system of East China Normal University
[byte jumps, autumn recruitment Posts open] ohayoo! Don't leave after school, I want to ask you to play games!!!
随机推荐
August 24, 2020: what are small documents? What's wrong with a lot of small files? How to solve many small files? (big data)
Using JSON webtoken (JWT) to generate token in nodejs
Benefits and functions of auto maintenance app development
NAND FLASH的接口控制设计
Stickinengine architecture 11 message queue
2020 database technology conference helps technology upgrade
#JVM 类加载机制
All the way, I was forced to talk about C code debugging skills and remote debugging
The 4th China BIM (digital construction) manager Summit Forum will be held in Hangzhou in 2020
The essence of transaction and the principle of deadlock
1万辆!理想汽车召回全部缺陷车:已发生事故97起,亏损将扩大
Plug in bilibilibili new version 0.5.5
南京标志设计,logo设计公司
Application insights application insights use application maps to build request link views
How to write plug-in code of small program mall system? How to use code to check whether the plug-in is successfully added?
ado.net and asp.net The relationship between
如何创建交互式内核密度图表
FreeSWITCH视频会议“标准”解决方案
New features of vue3
[elastic search engine]