1
0
mirror of https://github.com/hauke68/Magallanes.git synced 2025-09-13 20:50:18 +02:00

Feature for declaring the Hosts for reading from a URI (file, url).

This commit is contained in:
Andrs Montaez 2012-02-04 16:37:34 -02:00
parent 67d8eaaa00
commit 776b21ce08
2 changed files with 9 additions and 3 deletions

View File

@ -49,7 +49,14 @@ class Mage_Config
$hosts = array(); $hosts = array();
if (isset($config['hosts'])) { if (isset($config['hosts'])) {
if (is_array($config['hosts'])) {
$hosts = (array) $config['hosts']; $hosts = (array) $config['hosts'];
} else if (is_string($config['hosts'])) {
$fileContent = fopen($config['hosts'], 'r');
while (($host = fgets($fileContent)) == true) {
$hosts[] = trim($host);
}
}
} }
return $hosts; return $hosts;

View File

@ -3,8 +3,7 @@ deployment:
user: stg_user user: stg_user
from: ./ from: ./
to: /var/www/vhosts/example.com/staging to: /var/www/vhosts/example.com/staging
hosts: hosts: /tmp/current-staging-hosts.txt
- staging.example.com
tasks: tasks:
pre-deploy: pre-deploy:
- scm/update - scm/update