From 788aeb161a37de704aa588a18d05fe20a630300a Mon Sep 17 00:00:00 2001 From: Stepan Strelets Date: Thu, 16 Mar 2017 15:50:34 +0300 Subject: [PATCH] Add deploy stage --- src/PHPCensor/Builder.php | 2 +- src/PHPCensor/Plugin/Util/Executor.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PHPCensor/Builder.php b/src/PHPCensor/Builder.php index dd8e6593..6ccbf389 100644 --- a/src/PHPCensor/Builder.php +++ b/src/PHPCensor/Builder.php @@ -190,7 +190,7 @@ class Builder implements LoggerAwareInterface $this->setupBuild(); // Run the core plugin stages: - foreach (['setup', 'test'] as $stage) { + foreach (['setup', 'test', 'deploy'] as $stage) { $success &= $this->pluginExecutor->executePlugins($this->config, $stage); } diff --git a/src/PHPCensor/Plugin/Util/Executor.php b/src/PHPCensor/Plugin/Util/Executor.php index b9840f27..d502119d 100644 --- a/src/PHPCensor/Plugin/Util/Executor.php +++ b/src/PHPCensor/Plugin/Util/Executor.php @@ -154,6 +154,9 @@ class Executor // If we're in the "setup" stage, execution should not continue after // a plugin has failed: throw new Exception('Plugin failed: ' . $plugin); + } elseif ($stage === 'deploy') { + $this->logger->logFailure('PLUGIN: FAILED'); + $success = false; } else { // If we're in the "test" stage and the plugin is not allowed to fail, // then mark the build as failed: