Commit 3273bcf1 authored by helmo's avatar helmo

Issue #2754069 by Jon Pugh: Merge remote-tracking branch...

Issue #2754069 by Jon Pugh: Merge remote-tracking branch 'origin/2754069-decouple-install' into 7.x-3.x
parents 51be3138 39842d79
...@@ -16,6 +16,7 @@ class Provision_Context_site extends Provision_Context { ...@@ -16,6 +16,7 @@ class Provision_Context_site extends Provision_Context {
'aliases' => 'site: comma-separated URIs', 'aliases' => 'site: comma-separated URIs',
'redirection' => 'site: boolean for whether --aliases should redirect; default false', 'redirection' => 'site: boolean for whether --aliases should redirect; default false',
'client_name' => 'site: machine name of the client that owns this site', 'client_name' => 'site: machine name of the client that owns this site',
'install_method' => 'site: How to install the site; default profile. When set to "profile" the install profile will be run automatically. Otherwise, an empty database will be created. Additional modules may provide additional install_methods.',
'profile' => 'site: Drupal profile to use; default standard', 'profile' => 'site: Drupal profile to use; default standard',
'drush_aliases' => 'site: Comma-separated list of additional Drush aliases through which this site can be accessed.', 'drush_aliases' => 'site: Comma-separated list of additional Drush aliases through which this site can be accessed.',
); );
...@@ -40,6 +41,7 @@ class Provision_Context_site extends Provision_Context { ...@@ -40,6 +41,7 @@ class Provision_Context_site extends Provision_Context {
// this can potentially be handled by a Drupal sub class // this can potentially be handled by a Drupal sub class
$this->setProperty('profile', 'standard'); $this->setProperty('profile', 'standard');
$this->setProperty('install_method', 'profile');
} }
/** /**
......
...@@ -87,14 +87,28 @@ function drush_provision_drupal_provision_install() { ...@@ -87,14 +87,28 @@ function drush_provision_drupal_provision_install() {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE); drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
// call a backend task to do the actual installation. // Install site according to site_install_method.
$result = provision_backend_invoke(d()->name, "provision-install-backend", array(), array('client_email' => drush_get_option('client_email'))); drush_log(dt('Installing site with the "!method" method.', array(
// pass the login link back to the front end. '!method' => d()->install_method,
drush_set_option('login_link', $result['context']['login_link']); )), 'ok');
// Run Drupal installation if option was specified
if (d()->install_method == 'profile') {
// call a backend task to do the actual installation.
$result = provision_backend_invoke(d()->name, "provision-install-backend", array(), array('client_email' => drush_get_option('client_email')));
// pass the login link back to the front end.
drush_set_option('login_link', $result['context']['login_link']);
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL);
drush_set_option('installed', TRUE, 'site');
}
else {
drush_set_option('login_link', 'http://' . d()->uri . '/install.php');
}
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL);
drush_set_option('installed', TRUE, 'site');
_provision_drupal_maintain_aliases(); _provision_drupal_maintain_aliases();
} }
/** /**
...@@ -102,10 +116,17 @@ function drush_provision_drupal_provision_install() { ...@@ -102,10 +116,17 @@ function drush_provision_drupal_provision_install() {
* any changes to things such as available modules/ themes can take affect. * any changes to things such as available modules/ themes can take affect.
*/ */
function drush_provision_drupal_post_provision_install() { function drush_provision_drupal_post_provision_install() {
drush_set_option('installed', TRUE, 'site');
_provision_drupal_rebuild_caches(); // If Drupal profile was installed, rebuild drupal caches and save enabled packages for aegir.
drush_set_option('packages', _scrub_object(provision_drupal_system_map()), 'site'); if (d()->install_method == 'profile' && drush_get_option('installed', FALSE, 'site')) {
_provision_client_create_symlink(); _provision_drupal_rebuild_caches();
drush_include_engine('drupal', 'cron_key'); drush_set_option('packages', _scrub_object(provision_drupal_system_map()), 'site');
_provision_client_create_symlink();
drush_include_engine('drupal', 'cron_key');
}
// For all other install methods, just create the symlink.
else {
_provision_client_create_symlink();
}
} }
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