- Add build notifications back in

- Fix spelling mistake
- Add the sha output as part of the build script
This commit is contained in:
Joseph Schorr 2015-02-03 13:01:42 -05:00
parent 361fb33574
commit 07e85324e9
3 changed files with 31 additions and 3 deletions

View file

@ -74,11 +74,14 @@ class BuildComponent(BaseComponent):
yield trollius.From(self._set_status(ComponentStatus.BUILDING))
# Send the notification that the build has started.
build_job.send_notification('build_start')
# Retrieve the job's buildpack.
buildpack_url = self.user_files.get_file_url(build_job.repo_build.resource_key,
requires_cors=False)
logger.debug('Retreiving build package: %s', buildpack_url)
logger.debug('Retrieving build package: %s', buildpack_url)
buildpack = None
try:
buildpack = BuildPackage.from_url(buildpack_url)
@ -262,6 +265,9 @@ class BuildComponent(BaseComponent):
result.result()
self._build_status.set_phase(BUILD_PHASE.COMPLETE)
trollius.async(self._build_finished(BuildJobResult.COMPLETE))
# Send the notification that the build has completed successfully.
build_job.send_notification('build_success')
except ApplicationError as aex:
worker_error = WorkerError(aex.error, aex.kwargs.get('base_error'))
@ -269,6 +275,9 @@ class BuildComponent(BaseComponent):
self._build_status.set_error(worker_error.public_message(), worker_error.extra_data(),
internal_error=worker_error.is_internal_error())
# Send the notification that the build has failed.
build_job.send_notification('build_failure', error_message=worker_error.public_message())
# Mark the build as completed.
if worker_error.is_internal_error():
trollius.async(self._build_finished(BuildJobResult.INCOMPLETE))