Browse Source

Tweaks.

1.0
Andrés Montañez 10 years ago
parent
commit
724fc05b9e
  1. 1
      Mage/Command/BuiltIn/DeployCommand.php
  2. 1
      Mage/Command/BuiltIn/ReleasesCommand.php
  3. 4
      Mage/Command/BuiltIn/RollbackCommand.php
  4. 6
      Mage/Console.php
  5. 1
      Mage/Task/BuiltIn/Deployment/ReleaseTask.php
  6. 2
      Mage/Task/BuiltIn/Deployment/Strategy/BaseStrategyTaskAbstract.php
  7. 1
      Mage/Yaml/Parser.php

1
Mage/Command/BuiltIn/DeployCommand.php

@ -350,6 +350,7 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment
if (self::$deployStatus == self::SUCCEDED && $this->getConfig()->release('enabled', false) == true) { if (self::$deployStatus == self::SUCCEDED && $this->getConfig()->release('enabled', false) == true) {
// Execute the Releases // Execute the Releases
Console::output('Starting the <dark_gray>Releasing</dark_gray>'); Console::output('Starting the <dark_gray>Releasing</dark_gray>');
$completedTasks = 0;
foreach ($hosts as $hostKey => $host) { foreach ($hosts as $hostKey => $host) {
// Check if Host has specific configuration // Check if Host has specific configuration

1
Mage/Command/BuiltIn/ReleasesCommand.php

@ -28,6 +28,7 @@ class ReleasesCommand extends AbstractCommand implements RequiresEnvironment
*/ */
public function run() public function run()
{ {
$result = false;
$subCommand = $this->getConfig()->getArgument(1); $subCommand = $this->getConfig()->getArgument(1);
// Run Tasks for Deployment // Run Tasks for Deployment

4
Mage/Command/BuiltIn/RollbackCommand.php

@ -28,14 +28,16 @@ class RollbackCommand extends AbstractCommand implements RequiresEnvironment
*/ */
public function run() public function run()
{ {
$result = false;
$releaseId = $this->getConfig()->getArgument(1); $releaseId = $this->getConfig()->getArgument(1);
if (!is_numeric($releaseId)) { if (!is_numeric($releaseId)) {
Console::output('<red>This release is mandatory.</red>', 1, 2); Console::output('<red>This release is mandatory.</red>', 1, 2);
return false; return false;
} }
$lockFile = getcwd() . '/.mage/' . $this->getConfig()->getEnvironment() . '.lock'; $lockFile = getcwd() . '/.mage/' . $this->getConfig()->getEnvironment() . '.lock';
if (file_exists($lockFile) && ($subcommand == 'rollback')) { if (file_exists($lockFile)) {
Console::output('<red>This environment is locked!</red>', 1, 2); Console::output('<red>This environment is locked!</red>', 1, 2);
echo file_get_contents($lockFile); echo file_get_contents($lockFile);
return null; return null;

6
Mage/Console.php

@ -85,11 +85,10 @@ class Console
} }
}); });
// Load configuration $config = self::$config = new Config;
$configError = false; $configError = false;
try { try {
// Load Config // Load configuration
$config = self::$config = new Config;
$config->load($arguments); $config->load($arguments);
} catch (Exception $exception) { } catch (Exception $exception) {
@ -249,7 +248,6 @@ class Console
public static function readInput() public static function readInput()
{ {
$fp = fopen("php://stdin", "r"); $fp = fopen("php://stdin", "r");
$line = '';
$line = fgets($fp); $line = fgets($fp);
return rtrim($line); return rtrim($line);

1
Mage/Task/BuiltIn/Deployment/ReleaseTask.php

@ -36,6 +36,7 @@ class ReleaseTask extends AbstractTask implements IsReleaseAware, SkipOnOverride
*/ */
public function run() public function run()
{ {
$resultFetch = false;
if ($this->getConfig()->release('enabled', false) == true) { if ($this->getConfig()->release('enabled', false) == true) {
$releasesDirectory = $this->getConfig()->release('directory', 'releases'); $releasesDirectory = $this->getConfig()->release('directory', 'releases');
$symlink = $this->getConfig()->release('symlink', 'current'); $symlink = $this->getConfig()->release('symlink', 'current');

2
Mage/Task/BuiltIn/Deployment/Strategy/BaseStrategyTaskAbstract.php

@ -95,7 +95,7 @@ abstract class BaseStrategyTaskAbstract extends AbstractTask implements IsReleas
$directoryToDelete = $releasesDirectory . '/' . $releaseIdToDelete; $directoryToDelete = $releasesDirectory . '/' . $releaseIdToDelete;
if ($directoryToDelete != '/') { if ($directoryToDelete != '/') {
$command = 'rm -rf ' . $directoryToDelete; $command = 'rm -rf ' . $directoryToDelete;
$result = $result && $this->runCommandRemote($command); $this->runCommandRemote($command);
} }
} }
} }

1
Mage/Yaml/Parser.php

@ -480,6 +480,7 @@ class Parser
if ($isCurrentLineBlank) { if ($isCurrentLineBlank) {
$text .= substr($this->currentLine, $indentation); $text .= substr($this->currentLine, $indentation);
} else { } else {
/** @noinspection PhpUndefinedVariableInspection */
$text .= $matches[1]; $text .= $matches[1];
} }

Loading…
Cancel
Save