Commit 0f8ee6fa authored by drumm's avatar drumm Committed by Neil Drumm

write out db aliases

parent 48819871
......@@ -37,6 +37,9 @@ function db_drush_init($url = null) {
}
function db_drush_exit() {
if (PROVISION_CONTEXT_SERVER) {
provision_service('db')->write_alias();
}
// determine how to close it too.
provision_service('db')->close();
}
......@@ -301,6 +304,13 @@ class provisionService_db extends provisionService {
return 'localhost';
}
/**
* Write out server's drushrc alias file.
*/
function write_alias() {
$config = new provisionConfig_drushrc_alias(drush_get_option('db_host') . '-db', array('db_host', 'master_db_host', 'master_db_user', 'master_db_passwd'));
$config->write();
}
}
......
......@@ -3,7 +3,7 @@
include_once(dirname(__FILE__) . '/../provision.service.inc');
function http_drush_init($url = null) {
// todo same as http, consolidate
// todo same as db, consolidate
$command = drush_get_command();
$command = explode(" ", $command['command']);
if (preg_match("/^provision-/", $command[0])) {
......@@ -128,7 +128,7 @@ class provisionService_http extends provisionService {
* Write out server's drushrc alias file.
*/
function write_alias() {
$config = new provisionConfig_drushrc_alias(drush_get_option('web_host'), array('web_id', 'web_host', 'web_ports', 'web_group', 'restart_cmd'));
$config = new provisionConfig_drushrc_alias(drush_get_option('web_host') . '-web', array('web_host', 'web_ports', 'web_group', 'restart_cmd'));
$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