wrapper/docker: fix logging of docker build failures
This commit is contained in:
parent
9bd2bd46a9
commit
1374e2be74
1 changed files with 4 additions and 3 deletions
|
@ -39,14 +39,15 @@ class DockerWrapper(Wrapper):
|
||||||
tag,
|
tag,
|
||||||
] + (['-q'] if not config.runtime.verbose else [])
|
] + (['-q'] if not config.runtime.verbose else [])
|
||||||
logging.debug('Running docker cmd: ' + ' '.join(cmd))
|
logging.debug('Running docker cmd: ' + ' '.join(cmd))
|
||||||
|
mute_docker = not config.runtime.verbose
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
cmd,
|
cmd,
|
||||||
cwd=script_path,
|
cwd=script_path,
|
||||||
stdout=(sys.stdout if config.runtime.verbose else subprocess.PIPE),
|
capture_output=mute_docker,
|
||||||
stderr=(sys.stderr if config.runtime.verbose else subprocess.PIPE),
|
|
||||||
)
|
)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
logging.fatal('Failed to build docker image:\n' + result.stderr.decode())
|
error_msg = ('\n' + result.stderr.decode() + '\n') if mute_docker else ''
|
||||||
|
logging.fatal(f'Docker error: {error_msg}Failed to build docker image: see errors above: ^^^^')
|
||||||
exit(1)
|
exit(1)
|
||||||
else:
|
else:
|
||||||
# Check if the image for the version already exists
|
# Check if the image for the version already exists
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue