Merge pull request #1557 from jzelinskie/buildargs
buildman: mark missing buildargs as failure
This commit is contained in:
commit
20a6fdc73f
1 changed files with 10 additions and 1 deletions
|
@ -94,6 +94,7 @@ class BuildComponent(BaseComponent):
|
||||||
build_config = build_job.build_config
|
build_config = build_job.build_config
|
||||||
except BuildJobLoadException as irbe:
|
except BuildJobLoadException as irbe:
|
||||||
self._build_failure('Could not load build job information', irbe)
|
self._build_failure('Could not load build job information', irbe)
|
||||||
|
raise Return()
|
||||||
|
|
||||||
base_image_information = {}
|
base_image_information = {}
|
||||||
|
|
||||||
|
@ -141,6 +142,14 @@ class BuildComponent(BaseComponent):
|
||||||
'private_key': build_job.repo_build.trigger.private_key,
|
'private_key': build_job.repo_build.trigger.private_key,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# If the build args have no buildpack, mark it as a failure before sending
|
||||||
|
# it to a builder instance.
|
||||||
|
if not build_arguments['build_package'] and not build_arguments['git']:
|
||||||
|
logger.error('%s: insufficient build args: %s',
|
||||||
|
self._current_job.repo_build.uuid, build_arguments)
|
||||||
|
self._build_failure('Insufficient build arguments. No buildpack available.')
|
||||||
|
raise Return()
|
||||||
|
|
||||||
# Invoke the build.
|
# Invoke the build.
|
||||||
logger.debug('Invoking build: %s', self.builder_realm)
|
logger.debug('Invoking build: %s', self.builder_realm)
|
||||||
logger.debug('With Arguments: %s', build_arguments)
|
logger.debug('With Arguments: %s', build_arguments)
|
||||||
|
@ -262,7 +271,7 @@ class BuildComponent(BaseComponent):
|
||||||
def _build_failure(self, error_message, exception=None):
|
def _build_failure(self, error_message, exception=None):
|
||||||
""" Handles and logs a failed build. """
|
""" Handles and logs a failed build. """
|
||||||
self._build_status.set_error(error_message, {
|
self._build_status.set_error(error_message, {
|
||||||
'internal_error': str(exception) if exception else None
|
'internal_error': str(exception) if exception else None
|
||||||
})
|
})
|
||||||
|
|
||||||
build_id = self._current_job.repo_build.uuid
|
build_id = self._current_job.repo_build.uuid
|
||||||
|
|
Reference in a new issue