Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tweaks on port definition.

Now port can be defined into the hostname.
  • Loading branch information...
commit 51e7de06765cd558794025915393aa53ac3ffbd5 1 parent e42a1f1
@andres-montanez authored
View
13 Mage/Config.php
@@ -71,6 +71,19 @@ public function setHost($host)
return $this;
}
+ public function getHostName()
+ {
+ $info = explode(':', $this->_host);
+ return $info[0];
+ }
+
+ public function getHostPort()
+ {
+ $info = explode(':', $this->_host);
+ $info[] = $this->deployment('port', '22');
+ return $info[1];
+ }
+
public function getHost()
{
return $this->_host;
View
2  Mage/Task/BuiltIn/Deployment/Rsync.php
@@ -36,7 +36,7 @@ public function run()
}
$command = 'rsync -avz '
- . '--rsh="ssh -p' . $this->_config->deployment('port', '22') . '" '
+ . '--rsh="ssh -p' . $this->_config->getHostPort() . '" '
. $this->_excludes(array_merge($excludes, $userExcludes)) . ' '
. $this->_config->deployment('from') . ' '
. $this->_config->deployment('user') . '@' . $this->_config->getHost() . ':' . $deployToDirectory;
View
6 Mage/Task/Deploy.php
@@ -28,7 +28,7 @@ public function run(Mage_Config $config)
$tasks = 0;
$completedTasks = 0;
- Mage_Console::output('Deploying to <dark_gray>' . $host . '</dark_gray>');
+ Mage_Console::output('Deploying to <dark_gray>' . $config->getHostName() . '</dark_gray>');
$tasksToRun = $config->getTasks();
array_unshift($tasksToRun, 'deployment/rsync');
@@ -40,7 +40,7 @@ public function run(Mage_Config $config)
if (count($tasksToRun) == 0) {
Mage_Console::output('<light_purple>Warning!</light_purple> <dark_gray>No </dark_gray><light_cyan>Deployment</light_cyan> <dark_gray>tasks defined.</dark_gray>', 2);
- Mage_Console::output('Deployment to <dark_gray>' . $host . '</dark_gray> skipped!', 1, 3);
+ Mage_Console::output('Deployment to <dark_gray>' . $config->getHostName() . '</dark_gray> skipped!', 1, 3);
} else {
foreach ($tasksToRun as $taskName) {
@@ -65,7 +65,7 @@ public function run(Mage_Config $config)
$tasksColor = 'red';
}
- Mage_Console::output('Deployment to <dark_gray>' . $host . '</dark_gray> compted: <' . $tasksColor . '>' . $completedTasks . '/' . $tasks . '</' . $tasksColor . '> tasks done.', 1, 3);
+ Mage_Console::output('Deployment to <dark_gray>' . $config->getHostName() . '</dark_gray> compted: <' . $tasksColor . '>' . $completedTasks . '/' . $tasks . '</' . $tasksColor . '> tasks done.', 1, 3);
}
}
}
View
2  Mage/Task/TaskAbstract.php
@@ -45,7 +45,7 @@ public function init()
$releasesDirectory = '';
}
- $localCommand = 'ssh -p ' . $this->_config->deployment('port', '22') . ' '
+ $localCommand = 'ssh -p ' . $this->_config->getHostPort() . ' '
. '-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no '
. $this->_config->deployment('user') . '@' . $this->_config->getHost() . ' '
. '"cd ' . rtrim($this->_config->deployment('to'), '/') . $releasesDirectory . ' && '
View
2  Mage/Task/Update.php
@@ -16,7 +16,7 @@ public function run(Mage_Config $config)
if ($result == true) {
Mage_Console::output('OK' . PHP_EOL, 0);
} else {
- Mage_Console::output( 'FAIL' . PHP_EOL, 0);
+ Mage_Console::output('FAIL' . PHP_EOL, 0);
}
}
View
2  bin/mage
@@ -1,5 +1,5 @@
#!/bin/sh
-#VERSION:0.9.3
+#VERSION:0.9.4
SCRIPT=$(readlink -f $0)
DIR=$(dirname $SCRIPT)
View
2  bin/mage.php
@@ -24,7 +24,7 @@
$baseDir = dirname(dirname(__FILE__));
-define('MAGALLANES_VERSION', '0.9.3');
+define('MAGALLANES_VERSION', '0.9.4');
require_once $baseDir . '/Mage/spyc.php';
require_once $baseDir . '/Mage/Autoload.php';
View
2  docs/example-config/.mage/config/environment/production.yml
@@ -15,7 +15,7 @@ releases:
symlink: current
directory: releases
hosts:
- - s01.example.com
+ - s01.example.com:22
- s02.example.com
tasks:
pre-deploy:
Please sign in to comment.
Something went wrong with that request. Please try again.