当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- 如何创建交互式内核密度图表
- How does LeadTools detect, read and write barcodes
- Utility class functions (continuous update)
- vue3 新特性
- [elastic search engine]
- python3操作gitlab
- STM32F030F4P6兼容灵动微MM32F031F4P6
- Empty test suite appears in JUnit test
- Detect certificate expiration script
- [learning] interface test case writing and testing concerns
猜你喜欢
Logo design company, Nanjing
插件Bilibili新版0.5.5
How to create an interactive kernel density chart
The isolation level of transaction and its problems
Practice of Xiaoxiong school development board: real equipment access of smart street lamp sandbox experiment
南京标志设计,logo设计公司
Countdown | 2020 PostgreSQL Asia Conference - agenda arrangement of Chinese sub Forum
非易失性MRAM存储器应用于各级高速缓存
Message queue - Analysis
7.Swarm搭建集群
随机推荐
Code generator plug-in and creator preform file analysis
python3操作Jenkins模块api
How does LeadTools detect, read and write barcodes
非易失性MRAM存储器应用于各级高速缓存
20个XR项目路演,近20个资本机构出席!诚邀您参加2020 Qualcomm XR生态合作伙伴大会
NAND FLASH的接口控制设计
Reserved battery interface, built-in charge and discharge circuit and electricity meter, quickly help easily handle hand-held applications
[graffiti Internet of things footprints] panoramic introduction of graffiti cloud platform
QT audio and video development 46 video transmission UDP version
8.Swarm创建维护和水平扩展Service
大佬们如何在nginx镜像里面增加模块?
Message queue - Analysis
The 4th China BIM (digital construction) manager Summit Forum will be held in Hangzhou in 2020
2020-08-17: how to solve data skew in detail?
Experiment one
Zhou Jie: database system of East China Normal University
Stickinengine architecture 11 message queue
Es create a new index database and copy the old index library, practice pro test effective!
The isolation level of transaction and its problems
python3操作gitlab