in aws_lambda_builders/workflow.py [0:0]
def run(self):
"""
Actually perform the build by executing registered actions.
:raises WorkflowFailedError: If the workflow does not contain any actions or if one of the actions ran into
an error
:raises WorkflowUnknownError: If one of the actions in the workflow raised an unhandled exception
"""
LOG.debug("Running workflow '%s'", self.NAME)
if not self.actions:
raise WorkflowFailedError(
workflow_name=self.NAME, action_name=None, reason="Workflow does not have any actions registered"
)
for action in self.actions:
action_info = "{}:{}".format(self.NAME, action.NAME)
function_name = ""
if self.options and "build_logical_id" in self.options:
function_name = "{}:".format(self.options["build_logical_id"])
LOG.info("%s Running %s", function_name, action_info)
try:
action.execute()
LOG.debug("%s succeeded", action_info)
except ActionFailedError as ex:
LOG.debug("%s failed", action_info, exc_info=ex)
raise WorkflowFailedError(workflow_name=self.NAME, action_name=action.NAME, reason=str(ex))
except Exception as ex:
LOG.debug("%s raised unhandled exception", action_info, exc_info=ex)
raise WorkflowUnknownError(workflow_name=self.NAME, action_name=action.NAME, reason=str(ex))