python (Python)为Buildbot CI框架重新排序字典 - 在此处应用:https://github.com/carlessanagustin/buildbot-bootstrap/b

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python (Python)为Buildbot CI框架重新排序字典 - 在此处应用:https://github.com/carlessanagustin/buildbot-bootstrap/b相关的知识,希望对你有一定的参考价值。

build_names = []
build_names.append(dict(name='build_id', branch='master', slaves=['bbslave'], 
						scheduler=['single', 'force', 'periodic', 'nightly']))
build_names.append(dict(name='branch_id', branch='branch_id', slaves=['bbslave'], 
						scheduler=['single', 'periodic']))
build_names.append(dict(name='branch_idm', branch='master', slaves=['bbslave'], 	
						scheduler=['single', 'force','periodic']))

print ''
print 'original: ', build_names
print ''
temp = []
for build_name in build_names:
	temp.extend(build_name['scheduler'])
sched_names = list(set(temp))

branches = list(set([item['branch'] for item in build_names]))

scheduler_names = []
for sched_name in sched_names:
	for branch in branches:
		build_names_branch = [item['name'] for item in build_names if (item['branch'] == branch) and (item['scheduler'].count(sched_name) == 1)]
		if not len(build_names_branch) == 0:
			scheduler_names.append(dict(scheduler=sched_name, name=build_names_branch, branch=branch))

print 'result: ', scheduler_names
print ''

以上是关于python (Python)为Buildbot CI框架重新排序字典 - 在此处应用:https://github.com/carlessanagustin/buildbot-bootstrap/b的主要内容,如果未能解决你的问题,请参考以下文章

python高级编程

docker--buildbot安装

用于 C++ 持续集成的 buildbot vs hudson/jenkins

收藏清单系列 | python持续集成测试报告及其他资源

[BuildRelease Management]buildbot

将 BuildBot 集成到 JIRA