diff --git a/src/Mage/Command/BuiltIn/DeployCommand.php b/src/Mage/Command/BuiltIn/DeployCommand.php index 7d738de..e720d50 100644 --- a/src/Mage/Command/BuiltIn/DeployCommand.php +++ b/src/Mage/Command/BuiltIn/DeployCommand.php @@ -126,7 +126,7 @@ class DeployCommand extends AbstractCommand } if (!$this->runTasks($output, $preDeployTasks)) { - throw new DeploymentException(sprintf(' Tasks failed on %s stage, halting deployment', $this->getStageName()), 500); + throw new DeploymentException(sprintf(' Tasks failed on %s stage, halting deployment', $this->getStageName()), 50); } // Run On Deploy Tasks @@ -158,7 +158,7 @@ class DeployCommand extends AbstractCommand foreach ($hosts as $host) { $this->runtime->setWorkingHost($host); if (!$this->runTasks($output, $onDeployTasks)) { - throw new DeploymentException(sprintf(' Tasks failed on %s stage, halting deployment', $this->getStageName()), 500); + throw new DeploymentException(sprintf(' Tasks failed on %s stage, halting deployment', $this->getStageName()), 50); } $this->runtime->setWorkingHost(null); } @@ -182,7 +182,7 @@ class DeployCommand extends AbstractCommand foreach ($hosts as $host) { $this->runtime->setWorkingHost($host); if (!$this->runTasks($output, $onReleaseTasks)) { - throw new DeploymentException(sprintf(' Tasks failed on %s stage, halting deployment', $this->getStageName()), 500); + throw new DeploymentException(sprintf(' Tasks failed on %s stage, halting deployment', $this->getStageName()), 50); } $this->runtime->setWorkingHost(null); } @@ -206,7 +206,7 @@ class DeployCommand extends AbstractCommand foreach ($hosts as $host) { $this->runtime->setWorkingHost($host); if (!$this->runTasks($output, $postReleaseTasks)) { - throw new DeploymentException(sprintf(' Tasks failed on %s stage, halting deployment', $this->getStageName()), 500); + throw new DeploymentException(sprintf(' Tasks failed on %s stage, halting deployment', $this->getStageName()), 50); } $this->runtime->setWorkingHost(null); } @@ -228,7 +228,7 @@ class DeployCommand extends AbstractCommand } if (!$this->runTasks($output, $postDeployTasks)) { - throw new DeploymentException(sprintf(' Tasks failed on %s stage, halting deployment', $this->getStageName()), 500); + throw new DeploymentException(sprintf(' Tasks failed on %s stage, halting deployment', $this->getStageName()), 50); } } diff --git a/src/Mage/Command/BuiltIn/Releases/ListCommand.php b/src/Mage/Command/BuiltIn/Releases/ListCommand.php index 0c5b42c..a1d15db 100644 --- a/src/Mage/Command/BuiltIn/Releases/ListCommand.php +++ b/src/Mage/Command/BuiltIn/Releases/ListCommand.php @@ -61,7 +61,7 @@ class ListCommand extends AbstractCommand } if (!$this->runtime->getEnvironmentConfig('releases', false)) { - throw new DeploymentException('Releases are not enabled', 700); + throw new DeploymentException('Releases are not enabled', 70); } $output->writeln(sprintf(' Environment: %s', $this->runtime->getEnvironment())); @@ -89,7 +89,7 @@ class ListCommand extends AbstractCommand /** @var Process $process */ $process = $this->runtime->runRemoteCommand($cmdListReleases, false); if (!$process->isSuccessful()) { - throw new RuntimeException(sprintf('Unable to retrieve releases from host %s', $host), 800); + throw new RuntimeException(sprintf('Unable to retrieve releases from host %s', $host), 80); } $releases = explode(PHP_EOL, trim($process->getOutput())); @@ -104,7 +104,7 @@ class ListCommand extends AbstractCommand /** @var Process $process */ $process = $this->runtime->runRemoteCommand($cmdCurrentRelease, false); if (!$process->isSuccessful()) { - throw new RuntimeException(sprintf('Unable to retrieve current release from host %s', $host), 850); + throw new RuntimeException(sprintf('Unable to retrieve current release from host %s', $host), 85); } $currentReleaseId = explode('/', trim($process->getOutput())); diff --git a/src/Mage/Command/BuiltIn/Releases/RollbackCommand.php b/src/Mage/Command/BuiltIn/Releases/RollbackCommand.php index 407c3bb..06e81b6 100644 --- a/src/Mage/Command/BuiltIn/Releases/RollbackCommand.php +++ b/src/Mage/Command/BuiltIn/Releases/RollbackCommand.php @@ -60,7 +60,7 @@ class RollbackCommand extends DeployCommand } if (!$this->runtime->getEnvironmentConfig('releases', false)) { - throw new DeploymentException('Releases are not enabled', 700); + throw new DeploymentException('Releases are not enabled', 70); } // Check if the Release exists in all hosts @@ -90,7 +90,7 @@ class RollbackCommand extends DeployCommand return $exception->getCode(); } } else { - throw new DeploymentException(sprintf('Release %s is not available on all hosts', $releaseToRollback), 720); + throw new DeploymentException(sprintf('Release %s is not available on all hosts', $releaseToRollback), 72); } $output->writeln('Finished Magallanes'); diff --git a/src/Mage/Runtime/Runtime.php b/src/Mage/Runtime/Runtime.php index 5de34de..5fb8ba1 100644 --- a/src/Mage/Runtime/Runtime.php +++ b/src/Mage/Runtime/Runtime.php @@ -244,7 +244,7 @@ class Runtime return $this; } - throw new InvalidEnvironmentException(sprintf('The environment "%s" does not exists.', $environment), 1000); + throw new InvalidEnvironmentException(sprintf('The environment "%s" does not exists.', $environment), 100); } /** diff --git a/src/Mage/Task/BuiltIn/Deploy/TarGz/CleanupTask.php b/src/Mage/Task/BuiltIn/Deploy/TarGz/CleanupTask.php index b4a46e5..9fff701 100644 --- a/src/Mage/Task/BuiltIn/Deploy/TarGz/CleanupTask.php +++ b/src/Mage/Task/BuiltIn/Deploy/TarGz/CleanupTask.php @@ -34,7 +34,7 @@ class CleanupTask extends AbstractTask public function execute() { if (!$this->runtime->getEnvironmentConfig('releases', false)) { - throw new ErrorException('This task is only available with releases enabled', 400); + throw new ErrorException('This task is only available with releases enabled', 40); } $tarGzLocal = $this->runtime->getVar('targz_local'); diff --git a/src/Mage/Task/BuiltIn/Deploy/TarGz/CopyTask.php b/src/Mage/Task/BuiltIn/Deploy/TarGz/CopyTask.php index 97826b6..ba16706 100644 --- a/src/Mage/Task/BuiltIn/Deploy/TarGz/CopyTask.php +++ b/src/Mage/Task/BuiltIn/Deploy/TarGz/CopyTask.php @@ -34,7 +34,7 @@ class CopyTask extends AbstractTask public function execute() { if (!$this->runtime->getEnvironmentConfig('releases', false)) { - throw new DeploymentException('This task is only available with releases enabled', 400); + throw new DeploymentException('This task is only available with releases enabled', 40); } $user = $this->runtime->getEnvironmentConfig('user'); diff --git a/src/Mage/Task/BuiltIn/Deploy/TarGz/PrepareTask.php b/src/Mage/Task/BuiltIn/Deploy/TarGz/PrepareTask.php index 3375e2d..0830536 100644 --- a/src/Mage/Task/BuiltIn/Deploy/TarGz/PrepareTask.php +++ b/src/Mage/Task/BuiltIn/Deploy/TarGz/PrepareTask.php @@ -34,7 +34,7 @@ class PrepareTask extends AbstractTask public function execute() { if (!$this->runtime->getEnvironmentConfig('releases', false)) { - throw new DeploymentException('This task is only available with releases enabled', 400); + throw new DeploymentException('This task is only available with releases enabled', 40); } $tarGzLocal = $this->runtime->getTempFile();