Commit 27157cc9 authored by Adrian Rossouw's avatar Adrian Rossouw

Replace the @server_localhost with @server_master, which now has the ability...

Replace the @server_localhost with @server_master, which now has the ability to have a remote_host other than localhost.
parent 3f548ebc
......@@ -19,11 +19,11 @@ class provisionService_http extends provisionService {
function init() {
parent::init();
// System account
if ($this->server->name == '@server_localhost') {
if ($this->server->name == '@server_master') {
$this->server->setProperty('web_group', _provision_default_web_group());
}
else {
$this->server->web_group = d('@server_localhost')->web_group;
$this->server->web_group = d('@server_master')->web_group;
}
// Redirection urls
......
......@@ -37,15 +37,18 @@ function drush_provision_hostmaster_install($site = NULL) {
$data['master_db'] = "$scheme://$user:$pass@$host";
}
$server = '@server_localhost';
// TODO: support creation of an external db server
$server = '@server_master';
drush_backend_invoke_args("provision-save", array($server), array(
'context_type' => 'server',
// files
// files
'remote_host' => $site,
'aegir_root' => $aegir_root,
'script_user' => drush_get_option('script_user', 'aegir'),
'script_user' => drush_get_option('script_user', get_current_user()),
// apache
'http_service_type' => 'apache',
'web_group' => drush_get_option('web_group', _provision_default_web_group()),
'master_url' => "http://" . $site . "/",
// mysql
'db_service_type' => 'mysql',
'master_db' => $data['master_db'],
......
......@@ -17,7 +17,7 @@ function drush_provision_hostmaster_migrate_validate($site, $platform) {
$data = drush_get_merged_options();
// add a server record :
$server = '@server_localhost';
$server = '@server_master';
drush_backend_invoke_args("provision-save", array($server), array(
'context_type' => 'server',
'aegir_root' => dirname(rtrim($data['config_path'], '/')),
......
......@@ -25,7 +25,7 @@ function drush_provision_drupal_provision_verify() {
if (d()->type === 'server') {
provision_file()->create_dir(d()->config_path, dt('Provision configuration'), 0711);
if (d()->name == '@server_localhost') {
if (d()->name == '@server_master') {
provision_file()->create_dir(d()->backup_path, dt('Backup'), 0700);
provision_file()->create_dir(d()->include_path, dt('Provision PHP configuration'), 0711);
if (!provision_file()->exists(d()->include_path . '/global.inc')->succeed('Global configuration file exists')->status()) {
......
......@@ -263,13 +263,13 @@ class provisionServer extends provisionEnvironment {
$this->type = 'server';
$this->setProperty('remote_host', 'localhost');
if ($this->name == '@server_localhost') {
if ($this->name == '@server_master') {
$this->setProperty('aegir_root', getenv('HOME'));
$this->setProperty('script_user', get_current_user());
}
else {
$this->aegir_root = d('@server_localhost')->aegir_root;
$this->script_user = d('@server_localhost')->script_user;
$this->aegir_root = d('@server_master')->aegir_root;
$this->script_user = d('@server_master')->script_user;
}
$this->backup_path = $this->aegir_root . '/backups';
......@@ -418,8 +418,8 @@ class provisionPlatform extends provisionEnvironment {
static function option_documentation() {
return array(
'--root' => 'platform: path to a Drupal installation',
'--server' => 'drush backend server; default @server_localhost',
'--web_server' => 'web server hosting the platform; default @server_localhost',
'--server' => 'drush backend server; default @server_master',
'--web_server' => 'web server hosting the platform; default @server_master',
);
}
......@@ -430,10 +430,10 @@ class provisionPlatform extends provisionEnvironment {
$this->type = 'platform';
$this->setProperty('root');
$this->setProperty('server', '@server_localhost');
$this->setProperty('server', '@server_master');
$this->is_oid('server');
$this->setProperty('web_server', '@server_localhost');
$this->setProperty('web_server', '@server_master');
$this->is_oid('web_server');
$this->service_subscribe('http', $this->web_server->name);
}
......@@ -480,7 +480,7 @@ class provisionSite extends provisionEnvironment {
$this->setProperty('client_email');
$this->setProperty('aliases', array(), TRUE);
$this->setProperty('redirection', FALSE);
$this->setProperty('db_server', '@server_localhost');
$this->setProperty('db_server', '@server_master');
$this->is_oid('db_server');
$this->service_subscribe('db', $this->db_server->name);
......
......@@ -6,7 +6,7 @@ require_once DRUSH_BASE_PATH . '/commands/core/rsync.core.inc';
class provisionService extends provisionChainedState {
protected $server = '@server_localhost';
protected $server = '@server_master';
public $context;
function __construct($server) {
......
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