Adding a 'broken' and 'fixed' event
This commit is contained in:
parent
725ce70ae9
commit
e9e80c5179
|
@ -188,6 +188,13 @@ class Builder implements LoggerAwareInterface
|
|||
$this->build->sendStatusPostback();
|
||||
$success = true;
|
||||
|
||||
$previous_build = $this->build->getProject()->getLatestBuild();
|
||||
if ($previous_build) {
|
||||
$previous_state = $previous_build->getStatus();
|
||||
} else {
|
||||
$previous_state = Build::STATUS_NEW;
|
||||
}
|
||||
|
||||
try {
|
||||
// Set up the build:
|
||||
$this->setupBuild();
|
||||
|
@ -210,9 +217,19 @@ class Builder implements LoggerAwareInterface
|
|||
|
||||
if ($success) {
|
||||
$this->pluginExecutor->executePlugins($this->config, 'success');
|
||||
|
||||
if ($previous_state == Build::STATUS_FAILED || $previous_status == Build::STATUS_NEW) {
|
||||
$this->pluginExecutor->executePlugins($this->config, 'fixed');
|
||||
}
|
||||
|
||||
$this->buildLogger->logSuccess(Lang::get('build_success'));
|
||||
} else {
|
||||
$this->pluginExecutor->executePlugins($this->config, 'failure');
|
||||
|
||||
if ($previous_state == Build::STATUS_SUCCESS || $previous_status == Build::STATUS_NEW) {
|
||||
$this->pluginExecutor->executePlugins($this->config, 'broken');
|
||||
}
|
||||
|
||||
$this->buildLogger->logFailure(Lang::get('build_failed'));
|
||||
}
|
||||
} catch (\Exception $ex) {
|
||||
|
|
Loading…
Reference in a new issue