Commit 2d5060c0 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: Build and deploy each project in sequential mode

parent 6131adee
......@@ -175,32 +175,26 @@ def main(argv=None):
args = parseArgs(argv)
projects = args.project
if args.sequential: njobs = 1
else: njobs = len(projects)
pool = mp.Pool(njobs)
build = ft.partial(trigger_build,
server=args.server,
token=args.token,
production=args.production)
deploy = ft.partial(trigger_deploy,
server=args.server,
token=args.token,
production=args.production)
# Build packages in parallel
pids = pool.map(build, projects)
pool.close()
pool.join()
# Deploy sequentially, to avoid conflicts
# arising from simultaneous access to the
# channel directory
for project, pid in zip(projects, pids):
if pid is not None:
build = ft.partial(trigger_build,
server=args.server,
token=args.token,
production=args.production)
deploy = ft.partial(trigger_deploy,
server=args.server,
token=args.token,
production=args.production)
if args.sequential:
for project in projects:
pid = build(project)
deploy(project, pid)
else:
pool = mp.Pool(len(projects))
pids = pool.map(build, projects)
pool.starmap(deploy, zip(projects, pids))
pool.close()
pool.join()
if __name__ == '__main__':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment