def do_push(success_builds): @log_params_return('debug') def f(build): repo_dir = build['path'] push(repo_dir) head_tag = get_tag(repo_dir) if head_tag: push(repo_dir, ref=head_tag) return dict(build, commit=get_commit(repo_dir), tag=head_tag) return pmap(f, success_builds)
def analyze_all(analyze_single, success_builds): return pmap(analyze_single, success_builds, processes=4)
def test_pmap(): assert [2, 4, 6] == pmap(lambda x: x * 2, [1, 2, 3])
def sync_repos(repos, repo_paths, work_dir, branches, setup_branch): return pmap(partial(sync_repo, work_dir, branches, setup_branch), zip(repos, repo_paths))
def set_status(build_state, build_url): return pmap(partial(set_single_status, build_url), build_state)