From 8e603bd0d268d5bd4a0c412e4de8dc6aa20dd5db Mon Sep 17 00:00:00 2001 From: Alex V Kotelnikov Date: Thu, 13 Nov 2014 00:13:19 +0400 Subject: [PATCH] fixed bug with a env-configuration containing deployment description in hosts section --- Mage/Command/BuiltIn/DeployCommand.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Mage/Command/BuiltIn/DeployCommand.php b/Mage/Command/BuiltIn/DeployCommand.php index 943a630..7ee5235 100644 --- a/Mage/Command/BuiltIn/DeployCommand.php +++ b/Mage/Command/BuiltIn/DeployCommand.php @@ -439,13 +439,22 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment } else { $result = true; - foreach ($hosts as $host) { - $this->getConfig()->setHost($host); + foreach ($hosts as $hostKey => $host) { + $hostConfig = null; + if (is_array($host)) { + $hostConfig = $host; + $host = $hostKey; + } + // Set Host and Host Specific Config + $this->getConfig()->setHost($host); + $this->getConfig()->setHostConfig($hostConfig); $this->getConfig()->setReleaseId(-1); + $task = Factory::get('releases/rollback', $this->getConfig()); $task->init(); $result = $task->run() && $result; + } return $result; }