Print stdout only on fail
This commit is contained in:
parent
465c770247
commit
a8a32e91b9
4
build.py
4
build.py
@ -146,8 +146,10 @@ def docker_buildx(repository: str, tags: list[str], build_platforms: list[Docker
|
||||
*[t for label in labels for t in ("--tag", label)],
|
||||
"--pull", "--push", directory]
|
||||
print(" ".join(command))
|
||||
process = subprocess.run(command, stderr=subprocess.PIPE)
|
||||
process = subprocess.run(command, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
if process.returncode != 0:
|
||||
output = process.stdout.decode('utf-8')
|
||||
print(output)
|
||||
error = process.stderr.decode('utf-8')
|
||||
raise Exception(error)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user