本文整理匯總了Python中travispy.TravisPy.builds方法的典型用法代碼示例。如果您正苦於以下問題:Python TravisPy.builds方法的具體用法?Python TravisPy.builds怎麽用?Python TravisPy.builds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類travispy.TravisPy
的用法示例。
在下文中一共展示了TravisPy.builds方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: stop_all_builds
# 需要導入模塊: from travispy import TravisPy [as 別名]
# 或者: from travispy.TravisPy import builds [as 別名]
def stop_all_builds():
for username, repo_name, github_token, travis_ci_token in CREDS:
travis_session = TravisPy(token=travis_ci_token)
builds = travis_session.builds(slug="{}/{}".format(username, repo_name))
for build in builds:
if not build.finished:
success = build.cancel()
url = calculate_build_url(username, repo_name, build)
if success:
logger.info("Build {} aborted".format(url))
else:
logger.error("Build {} fails to abort".format(url))
示例2: main
# 需要導入模塊: from travispy import TravisPy [as 別名]
# 或者: from travispy.TravisPy import builds [as 別名]
def main():
travis = TravisPy()
revision = check_output(["git", "rev-parse", "HEAD"]).strip()
build_passed = False
for build in travis.builds(slug="datawire/mdk"):
if build.commit.sha == revision:
if build.passed:
build_passed = True
break
else:
error("Found the build but it has not passed.\n Build state: "
+ build.state +
"\n Build URL: https://travis-ci.org/datawire/mdk/builds/"
+ str(build.id))
if not build_passed:
error("No matching build found on Travis CI.")
示例3: TravisPy
# 需要導入模塊: from travispy import TravisPy [as 別名]
# 或者: from travispy.TravisPy import builds [as 別名]
'grosser/parallel_tests',
'mongodb/mongo-python-driver',
'scambra/devise_invitable',
'dennisreimann/ioctocat',
'cython/cython',
'mongomapper/mongomapper',
'publify/publify'
]
t = TravisPy()
builds_result = []
for project in projects:
builds = t.builds(slug=project, event_type='pull_request')
labels = ['project', 'pull_number', 'started_at', 'finished_at', 'branch', 'build_status']
count = 1
print ' {:_<6} {:_<26} {:_^12} {:_^8} {:_^8} '.format('','','','','')
print '|{:^6}|{:^26}|{:^12}|{:^8}|{:^8}|'.format('#','project','pull_number', 'branch', 'status')
while builds:
for build in builds:
print '|{:_<6}|{:_<26}|{:_^12}|{:_^8}|{:_^8}|'.format('','','','','')
print '|{:^6}|{:^26}|{:^12}|{:^8}|{:^8}|'.format(count, project, build.pull_request_number, build.commit.branch, build.color)
data = [project, build.pull_request_number,
build.started_at, build.finished_at, build.commit.branch, build.color]