本文整理汇总了Python中autojenkins.Jenkins.job_info方法的典型用法代码示例。如果您正苦于以下问题:Python Jenkins.job_info方法的具体用法?Python Jenkins.job_info怎么用?Python Jenkins.job_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autojenkins.Jenkins
的用法示例。
在下文中一共展示了Jenkins.job_info方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Jenkins
# 需要导入模块: from autojenkins import Jenkins [as 别名]
# 或者: from autojenkins.Jenkins import job_info [as 别名]
#!/usr/bin/python
import time
from autojenkins import Jenkins
j = Jenkins('http://192.168.1.216:8080/')
# Create a new job.
j.create_copy('my-new-job', 'Selenium-Test', repo='my-repo', branch='my-branch')
newjob = j.job_info('my-new-job')
while newjob != 'null':
print 'Job Created Successfully'
break
else:
time.sleep(1)
示例2: Jenkins
# 需要导入模块: from autojenkins import Jenkins [as 别名]
# 或者: from autojenkins.Jenkins import job_info [as 别名]
date_regexp = re.compile("(\d+-\d+-\d+)")
jobHash = {}
if __name__ == '__main__':
j = Jenkins('http://135.251.224.94:8080/')
jobs = j.all_jobs()
print(jobs)
for job, color in jobs:
if color in ['red', 'blue', 'yellow']:
full_info = j.job_info(job)
last_build = j.last_build_info(job)
when = datetime.fromtimestamp(last_build['timestamp'] / 1000)
else:
when = '(unknown)'
print("{0!s:<19} {1:<6} {2}".format(when, color, job))
#print "Build!"
#j.build("CodeWarrior_Build_Test")
#print "Waiting"
#j.wait_for_build("CodeWarrior_Build_Test")
#print "Result!"
#j.last_build_info("CodeWarrior_Build_Test")
#print "Create another"
test = "YangSen"
#j.create(test, "config.xml")
示例3: Jenkins
# 需要导入模块: from autojenkins import Jenkins [as 别名]
# 或者: from autojenkins.Jenkins import job_info [as 别名]
#!/usr/bin/python
import time
from autojenkins import Jenkins
j = Jenkins('http://192.168.1.216:8080/')
# Build new job.
print "Building Job"
j.build('my-new-job')
while j.job_info('my-new-job')['color'] == 'notbuilt' or j.job_info('my-new-job')['color'] == 'notbuilt_anime':
#print j.job_info('my-new-job')['color']
time.sleep(1)
if j.job_info('my-new-job')['color'] == 'blue' or j.job_info('my-new-job')['color'] == 'yellow' or j.job_info('my-new-job')['color'] == 'red':
#print j.job_info('my-new-job')['color']
print 'Build Completed'
break
if j.last_result('my-new-job')['result'] == 'SUCCESS':
print 'Job was built successfully'
else:
print 'Build failed'