Commit 39c0c45c authored by drumm's avatar drumm Committed by Neil Drumm

Move from parents to --provision-... arguments for contexts.

parent 27244923
......@@ -270,7 +270,7 @@ class provisionService_db extends provisionService {
* Write out server's drushrc alias file.
*/
function write_alias() {
return array(drush_get_option('provision-service-db') => array('provision-service-db', 'master_db'));
return array('provision-service-db', 'master_db');
}
}
......
......@@ -99,10 +99,6 @@ class provisionService_http extends provisionService {
* Write out server's drushrc alias file.
*/
function write_alias() {
drush_set_option('path-aliases', array(
'%drush-script' => drush_get_option('drush_path'),
));
drush_set_option('remote-host', drush_get_option('web_host'));
return array(drush_get_option('provision-service-http') => array('provision-service-http', 'remote-host', 'remote-user', 'path-aliases', 'web_host', 'web_ip', 'web_ports', 'web_group', 'restart_cmd'));
return array('provision-service-http', 'web_ports', 'web_group', 'restart_cmd');
}
}
......@@ -210,27 +210,20 @@ function drush_provision_hostmaster_make($platform) {
function drush_http_provision_named_context_save() {
if (PROVISION_CONTEXT_SERVER) {
$parents = array();
$options = array('provision-context', 'provision-host', 'provision-user', 'config_path', 'backup_path');
foreach (provision_service('all') as $service) {
foreach ($service->write_alias() as $key => $value) {
$parents[] = drush_get_option('hosting_name') . '-' . $key;
$config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') . '-' . $key => $value));
$config->write();
}
$options = array_merge($options, $service->write_alias());
}
drush_set_option('parent', '@' . implode(',@', $parents));
$config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') => array('parent', 'provision-context', 'config_path', 'backup_path')));
$config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') => $options));
$config->write();
}
elseif (PROVISION_CONTEXT_PLATFORM) {
drush_set_option('platform-name', preg_replace('/^platform_/', '', drush_get_option('hosting_name')));
$config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') => array('parent', 'provision-context', 'root', 'platform-name')));
$config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') => array('provision-http-server', 'provision-context', 'root', 'platform-name')));
$config->write();
}
elseif (PROVISION_CONTEXT_SITE) {
$config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') => array('parent', 'provision-context', 'uri', 'site_port', 'site_id', 'language', 'client_email')));
$config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') => array('provision-db-server', 'provision-platform', 'provision-context', 'uri', 'site_port', 'site_id', 'language', 'client_email')));
$config->write();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment