Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions buildrunner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import sys
import tarfile
import tempfile
import traceback
import types
from typing import List, Optional

Expand All @@ -35,6 +36,7 @@
from buildrunner.errors import (
BuildRunnerConfigurationError,
BuildRunnerProcessingError,
BuildRunnerError,
)
from buildrunner.steprunner import BuildStepRunner
from buildrunner.docker.multiplatform_image_builder import MultiplatformImageBuilder
Expand Down Expand Up @@ -470,13 +472,6 @@ def run(self): # pylint: disable=too-many-statements,too-many-branches,too-many
)
else:
self.log.write("\nPush not requested\n")

except BuildRunnerConfigurationError as brce:
exit_explanation = str(brce)
self.exit_code = os.EX_CONFIG
except BuildRunnerProcessingError as brpe:
exit_explanation = str(brpe)
self.exit_code = 1
except requests.exceptions.ConnectionError as rce:
print(str(rce))
exit_explanation = (
Expand All @@ -486,6 +481,14 @@ def run(self): # pylint: disable=too-many-statements,too-many-branches,too-many
"remote PyPi server information is set correctly."
)
self.exit_code = 1
except BuildRunnerError as exc:
exit_explanation = str(exc)
self.exit_code = (
os.EX_CONFIG if isinstance(exc, BuildRunnerConfigurationError) else 1
)
except Exception as exc:
exit_explanation = f"Encountered unhandled exception ({type(exc).__name__}) {traceback.format_exc()}"
self.exit_code = 1

finally:
self._write_artifact_manifest()
Expand Down
4 changes: 4 additions & 0 deletions tests/config-files/dot-buildrunner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ caches-root: ~/.buildrunner/caches
# buildrunner scripts
env:
GLOBAL_VAR1: 'value1'

# The 'docker-registry' global configuration specifies the default docker registry
# Use the AWS public ECR as it has higher rate limits than Docker Hub
docker-registry: public.ecr.aws/docker/library
Loading