Run each build using docker exec, for faster builds

This commit is contained in:
Joe Rickerby
2020-03-11 21:55:53 +00:00
parent 7efec9a0fc
commit c4f54c6aa3
+4 -2
View File
@@ -100,11 +100,13 @@ def build(project_dir, output_dir, test_command, before_test, test_requires, tes
'--name', container_name,
'-i',
'-v', '/:/host', # ignored on CircleCI
docker_image, '/bin/bash'], check=True)
docker_image], check=True)
subprocess.run(['docker', 'cp',
os.path.abspath(project_dir) + '/.',
container_name + ':/project'], check=True)
subprocess.run(['docker', 'start', container_name])
for config in platform_configs:
if dependency_constraints:
constraints_file = dependency_constraints.get_for_python_version(config.version)
@@ -113,7 +115,7 @@ def build(project_dir, output_dir, test_command, before_test, test_requires, tes
container_name + ':/constraints.txt'], check=True)
subprocess.run(
['docker', 'start', '-i', '-a', container_name],
['docker', 'exec', '-i', container_name, '/bin/bash'],
universal_newlines=True,
check=True,
input='''