Fix piping script into docker bash

This commit is contained in:
Joe Rickerby
2020-02-15 12:32:33 +00:00
parent 50bd6f41da
commit 4c076b8d41
+6 -2
View File
@@ -69,7 +69,10 @@ def build(project_dir, output_dir, test_command, test_requires, test_extras, bef
constraints_file = dependency_constraints.get_for_python_version(config.version) constraints_file = dependency_constraints.get_for_python_version(config.version)
subprocess.run(['docker', 'cp', os.path.abspath(constraints_file), container_name + ':/constraints.txt']) subprocess.run(['docker', 'cp', os.path.abspath(constraints_file), container_name + ':/constraints.txt'])
subprocess.run(['docker', 'start', '-i', '-a', container_name], stdin_str=''' subprocess.run(
['docker', 'start', '-i', '-a', container_name],
universal_newlines=True,
input='''
set -o errexit set -o errexit
set -o xtrace set -o xtrace
mkdir -p /output mkdir -p /output
@@ -172,7 +175,8 @@ def build(project_dir, output_dir, test_command, test_requires, test_extras, bef
uid=os.getuid(), uid=os.getuid(),
gid=os.getgid(), gid=os.getgid(),
dependency_install_flags='-c /constraints.txt' if dependency_constraints else '', dependency_install_flags='-c /constraints.txt' if dependency_constraints else '',
)) )
)
# copy the output back into the host # copy the output back into the host
subprocess.run(['docker', 'cp', container_name + ':/output/.', os.path.abspath(output_dir)]) subprocess.run(['docker', 'cp', container_name + ':/output/.', os.path.abspath(output_dir)])