Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/worker/HarbormasterTargetWorker.php
Show All 40 Lines | try { | ||||
$target->setTargetStatus(HarbormasterBuildTarget::STATUS_FAILED); | $target->setTargetStatus(HarbormasterBuildTarget::STATUS_FAILED); | ||||
$target->save(); | $target->save(); | ||||
} else { | } else { | ||||
$implementation->execute($build, $target); | $implementation->execute($build, $target); | ||||
$target->setTargetStatus(HarbormasterBuildTarget::STATUS_PASSED); | $target->setTargetStatus(HarbormasterBuildTarget::STATUS_PASSED); | ||||
$target->save(); | $target->save(); | ||||
} | } | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
phlog($ex); | |||||
try { | |||||
$log = $build->createLog($target, 'core', 'exception'); | |||||
$start = $log->start(); | |||||
$log->append((string)$ex); | |||||
$log->finalize($start); | |||||
} catch (Exception $log_ex) { | |||||
phlog($log_ex); | |||||
} | |||||
$target->setTargetStatus(HarbormasterBuildTarget::STATUS_FAILED); | $target->setTargetStatus(HarbormasterBuildTarget::STATUS_FAILED); | ||||
$target->save(); | $target->save(); | ||||
} | } | ||||
id(new HarbormasterBuildEngine()) | id(new HarbormasterBuildEngine()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->setBuild($build) | ->setBuild($build) | ||||
->continueBuild(); | ->continueBuild(); | ||||
} | } | ||||
} | } |