Commit 3140807c authored by drumm's avatar drumm Committed by Neil Drumm

clean up alias saving

parent ed743c18
......@@ -303,7 +303,7 @@ class provisionService_db extends provisionService {
* Write out server's drushrc alias file.
*/
function write_alias() {
return array(drush_get_option('init_db') => array('master_db'));
return array(drush_get_option('init_db') => array('init_db', 'master_db'));
}
}
......
......@@ -122,6 +122,6 @@ class provisionService_http extends provisionService {
* Write out server's drushrc alias file.
*/
function write_alias() {
return array(drush_get_option('init_http') => array('web_host', 'web_ports', 'web_group', 'restart_cmd'));
return array(drush_get_option('init_http') => array('init_http', 'web_host', 'web_ports', 'web_group', 'restart_cmd'));
}
}
......@@ -167,7 +167,7 @@ class provisionConfig_drushrc_alias extends provisionConfig_drushrc {
}
function filename() {
return drush_get_option('alias-path', drush_server_home() . '/.drush/aliases/') . $this->data['aliasname'];
return drush_get_option('alias-path', drush_server_home() . '/.drush/aliases') . '/' . $this->data['aliasname'] . '.alias.drushrc.php';
}
}
......
......@@ -211,19 +211,17 @@ function drush_provision_hostmaster_make($platform) {
function drush_http_provision_named_context_save() {
if (PROVISION_CONTEXT_SERVER) {
$parents = array();
$contexts = array(
drush_get_option('hosting_name') => array('parents'),
);
foreach (provision_service('all') as $service) {
foreach ($service->write_alias() as $key => $value) {
$parents[] = drush_get_option('hosting_name') . '-' . $key;
$contexts[drush_get_option('hosting_name') . '-' . $key] = $value;
$config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') . '-' . $key => $value));
$config->write();
}
}
drush_set_option('parents', '@' . implode(',@', $parents));
$config = new provisionConfig_drushrc_alias($contexts);
drush_set_option('parent', '@' . implode(',@', $parents));
$config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') => array('parent')));
$config->write();
}
}
......
......@@ -84,6 +84,7 @@ class provisionService {
}
function write_alias() {
return array();
}
}
......
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