當前位置: 首頁>>代碼示例>>Python>>正文


Python Jenkins.job_info方法代碼示例

本文整理匯總了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)
開發者ID:oneshore,項目名稱:jenkins-selenium-example,代碼行數:17,代碼來源:newjenkinsjob.py

示例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")
開發者ID:nuaays,項目名稱:AutomateJenkins,代碼行數:33,代碼來源:demo_run_new_createjob.py

示例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'	
開發者ID:oneshore,項目名稱:jenkins-selenium-example,代碼行數:24,代碼來源:buildandcheck.py


注:本文中的autojenkins.Jenkins.job_info方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。