Catch docker run exceptions
Former-commit-id: 68c7f91052a6b6c14eb4c7f8e8c0f7936441114d
This commit is contained in:
parent
7a9926b695
commit
429e04f81d
@ -23,7 +23,7 @@ from decouple import config
|
||||
import click
|
||||
import importlib.resources
|
||||
from pathlib import Path
|
||||
from python_on_whales import docker
|
||||
from python_on_whales import docker, DockerException
|
||||
import yaml
|
||||
from .util import include_exclude_check
|
||||
|
||||
@ -84,6 +84,7 @@ def command(ctx, include, exclude):
|
||||
if verbose:
|
||||
print(f"Executing: {build_command}")
|
||||
envs = {"CERC_NPM_AUTH_TOKEN": os.environ["CERC_NPM_AUTH_TOKEN"]} | ({"CERC_SCRIPT_DEBUG": "true"} if debug else {})
|
||||
try:
|
||||
build_result = docker.run("cerc/builder-js",
|
||||
remove=True,
|
||||
interactive=True,
|
||||
@ -96,6 +97,8 @@ def command(ctx, include, exclude):
|
||||
)
|
||||
# TODO: check result in build_result.returncode
|
||||
print(f"Result is: {build_result}")
|
||||
except DockerException as e:
|
||||
print(f"FATAL error executing build in container:\n {e}")
|
||||
else:
|
||||
print("Skipped")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user