Commit cf6b7779 authored by drumm's avatar drumm Committed by Neil Drumm
Browse files

Cleanup work focusing on making sure extrnal servers are working.

parent 1b8cf5de
...@@ -14,13 +14,3 @@ function drush_db_provision_verify() { ...@@ -14,13 +14,3 @@ function drush_db_provision_verify() {
provision_service('db')->verify(); provision_service('db')->verify();
} }
} }
function drush_db_post_provision_verify() {
if (PROVISION_CONTEXT_PLATFORM) {
drush_unset_option('master_db', 'drupal');
}
if (PROVISION_CONTEXT_SERVER) {
drush_set_option('master_db', drush_get_option('master_db'), 'user');
}
}
...@@ -37,12 +37,9 @@ class provisionService_http_apache extends provisionService_http { ...@@ -37,12 +37,9 @@ class provisionService_http_apache extends provisionService_http {
return $config->unlink(); return $config->unlink();
} }
function verify() { function verify() {
if (PROVISION_CONTEXT_PLATFORM) { if (PROVISION_CONTEXT_PLATFORM) {
if (drush_get_option('platform', null)) { $this->create_platform_config();
$this->create_platform_config();
}
} }
elseif (PROVISION_CONTEXT_SERVER) { elseif (PROVISION_CONTEXT_SERVER) {
provision_service('file')->create_dir(drush_get_option('vhost_path'), dt("Virtual host configuration"), 0700); provision_service('file')->create_dir(drush_get_option('vhost_path'), dt("Virtual host configuration"), 0700);
...@@ -105,7 +102,7 @@ class provisionConfig_apache_platform extends provisionConfig_apache { ...@@ -105,7 +102,7 @@ class provisionConfig_apache_platform extends provisionConfig_apache {
public $description = 'apache platform configuration file'; public $description = 'apache platform configuration file';
function filename() { function filename() {
return $this->data['platform_conf_path'] . '/platform_' . $this->data['platform'] . '.conf'; return $this->data['platform_conf_path'] . '/platform_' . $this->data['platform-name'] . '.conf';
} }
function process() { function process() {
......
...@@ -3,29 +3,3 @@ ...@@ -3,29 +3,3 @@
function drush_http_provision_verify() { function drush_http_provision_verify() {
provision_service('http')->verify(); provision_service('http')->verify();
} }
function drush_http_post_provision_verify() {
if (PROVISION_CONTEXT_PLATFORM) {
drush_set_option('publish_path', realpath(drush_get_option('publish_path')), 'drupal');
drush_unset_option('master_url', 'drupal');
drush_unset_option('web_host', 'drupal');
drush_unset_option('web_ip', 'drupal');
drush_unset_option('web_group', 'drupal');
drush_unset_option('script_user', 'drupal');
drush_unset_option('restart_cmd', 'drupal');
drush_unset_option('backup_path', 'drupal');
drush_unset_option('config_path', 'drupal');
}
elseif (PROVISION_CONTEXT_SERVER) {
drush_log("saving settings in the server context");
drush_set_option('master_url', drush_get_option('master_url'), 'user');
drush_set_option('web_host', drush_get_option('web_host', '127.0.0.1'), 'user');
drush_set_option('web_ip', drush_get_option('web_ip', ''), 'user');
drush_set_option('web_port', drush_get_option('web_port', 80), 'user');
drush_set_option('web_group', drush_get_option('web_group'), 'user');
drush_set_option('script_user', drush_get_option('script_user'), 'user');
drush_set_option('restart_cmd', drush_get_option('restart_cmd', _provision_default_restart_cmd(), 'user'), 'user');
drush_set_option('backup_path', drush_get_option('backup_path'), 'user');
drush_set_option('config_path', drush_get_option('config_path'), 'user');
}
}
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
*/ */
function drush_provision_hostmaster_install($site) { function drush_provision_hostmaster_install($site) {
drush_set_option('alias-path', drush_server_home() . '/.drush/aliases');
if (!$site) { if (!$site) {
return drush_set_error('SITE_MISSING', dt('You need to specify the FQDN of the hostmaster install')); return drush_set_error('SITE_MISSING', dt('You need to specify the FQDN of the hostmaster install'));
} }
...@@ -36,7 +37,8 @@ function drush_provision_hostmaster_install($site) { ...@@ -36,7 +37,8 @@ function drush_provision_hostmaster_install($site) {
print "\n"; # add a cr since the user's didn't echo print "\n"; # add a cr since the user's didn't echo
$data['master_db'] = "$scheme://$user:$pass@$host"; $data['master_db'] = "$scheme://$user:$pass@$host";
} }
$data['hosting_name'] = 'server_localhost';
$data['provision-service-http'] = 'apache'; $data['provision-service-http'] = 'apache';
$data['provision-service-db'] = 'mysql'; $data['provision-service-db'] = 'mysql';
$data['provision-context'] = 'server'; $data['provision-context'] = 'server';
...@@ -49,26 +51,27 @@ function drush_provision_hostmaster_install($site) { ...@@ -49,26 +51,27 @@ function drush_provision_hostmaster_install($site) {
$data['drush_path'] = DRUSH_COMMAND; $data['drush_path'] = DRUSH_COMMAND;
// verify the server // verify the server
drush_backend_invoke('provision-verify', $data, 'POST'); drush_backend_invoke('provision-named-context-save', $data, 'POST');
drush_do_site_command(drush_sitealias_get_record('@server_localhost'), 'provision-verify');
if (drush_get_option('backend-only')) { if (drush_get_option('backend-only')) {
return; return;
} }
// verify the current platform // verify the current platform
drush_backend_invoke('provision-verify', array( drush_backend_invoke('provision-named-context-save', array(
'parent' => '@server_localhost-apache', // todo should match future node title
'hosting_name' => 'platform_Hostmaster', // todo should match future node title
'provision-context' => 'platform',
'root' => $platform, 'root' => $platform,
'provision-context' => "platform", ));
'publish_path' => $platform, drush_do_site_command(drush_sitealias_get_record('@platform_Hostmaster'), 'provision-verify');
'platform' => '5') // dirty hardcoded to create the first platform apache config
// this will become unnecessary when we have drush aliases
);
// install the hostmaster site // install the hostmaster site
$data = drush_backend_invoke('provision-install', array( $data = drush_backend_invoke('provision-install', array(
$site, 'hosting_name' => '',//todo
'parent' => '@server_localhost-mysql,@platform_Hostmaster',
'uri' => $site, 'uri' => $site,
'root' => $platform,
'client_email' => drush_get_option('client_email', 'webmaster@localhost'), 'client_email' => drush_get_option('client_email', 'webmaster@localhost'),
'profile' => "hostmaster", 'profile' => "hostmaster",
'provision-context' => "site", 'provision-context' => "site",
......
...@@ -122,9 +122,6 @@ function provision_drupal_drush_exit() { ...@@ -122,9 +122,6 @@ function provision_drupal_drush_exit() {
provision_save_platform_data(); provision_save_platform_data();
} }
} }
elseif (PROVISION_CONTEXT_SERVER) {
provision_save_server_data();
}
} }
} }
......
...@@ -171,14 +171,6 @@ class provisionConfig_drushrc_alias extends provisionConfig_drushrc { ...@@ -171,14 +171,6 @@ class provisionConfig_drushrc_alias extends provisionConfig_drushrc {
} }
} }
/**
* Server level config for drushrc.php files.
*/
class provisionConfig_drushrc_server extends provisionConfig_drushrc {
protected $context_name = 'user';
public $description = 'Server drush configuration';
}
/** /**
* Class for writing $platform/drushrc.php files. * Class for writing $platform/drushrc.php files.
*/ */
......
...@@ -221,17 +221,16 @@ function drush_http_provision_named_context_save() { ...@@ -221,17 +221,16 @@ function drush_http_provision_named_context_save() {
} }
drush_set_option('parent', '@' . implode(',@', $parents)); drush_set_option('parent', '@' . implode(',@', $parents));
$config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') => array('parent', 'provision-context'))); $config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') => array('parent', 'provision-context', 'config_path', 'backup_path')));
$config->write(); $config->write();
} }
elseif (PROVISION_CONTEXT_PLATFORM) { elseif (PROVISION_CONTEXT_PLATFORM) {
$config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') => array('parent', 'provision-context', 'publish_path'))); 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->write(); $config->write();
} }
elseif (PROVISION_CONTEXT_SITE) { elseif (PROVISION_CONTEXT_SITE) {
drush_set_option('uri', drush_get_option('provision-uri')); $config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') => array('parent', 'provision-context', 'uri', 'site_port', 'site_id', 'language', 'client_email')));
drush_set_option('root', drush_get_option('publish_path'));
$config = new provisionConfig_drushrc_alias(array(drush_get_option('hosting_name') => array('parent', 'provision-context', 'root', 'uri', 'site_port', 'site_id', 'language')));
$config->write(); $config->write();
} }
} }
......
...@@ -47,16 +47,6 @@ function provision_save_platform_data() { ...@@ -47,16 +47,6 @@ function provision_save_platform_data() {
} }
} }
/**
* Save modified options to the drushrc.php file
*/
function provision_save_server_data() {
if (!drush_get_error()) {
$config = new provisionConfig_drushrc_server();
$config->write();
}
}
/** /**
* @} End of "defgroup sitedata". * @} End of "defgroup sitedata".
*/ */
......
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