Skip to content

Commit d298f9e

Browse files
committed
docker: support --break-on-failure
1 parent 3fb505f commit d298f9e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pythonbuild/docker.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import contextlib
66
import io
77
import operator
8+
import os
89
import pathlib
910
import tarfile
1011

@@ -125,6 +126,12 @@ def container_exec(container, command, user="build", environment=None):
125126
inspect_res = container.client.api.exec_inspect(create_res["Id"])
126127

127128
if inspect_res["ExitCode"] != 0:
129+
if "PYBUILD_BREAK_ON_FAILURE" in os.environ:
130+
print("to enter container: docker exec -it %s /bin/bash" % container.id)
131+
import pdb
132+
133+
pdb.set_trace()
134+
128135
raise Exception("exit code %d from %s" % (inspect_res["ExitCode"], command))
129136

130137

0 commit comments

Comments
 (0)