Commit 71beacc6 authored by Jon Pugh's avatar Jon Pugh

Merge branch '2754069-decouple-install-alternate' into 7.x-3.x-devshop

parents 7adc6625 326e1b6c
......@@ -16,6 +16,7 @@ class Provision_Context_site extends Provision_Context {
'aliases' => 'site: comma-separated URIs',
'redirection' => 'site: boolean for whether --aliases should redirect; default false',
'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',
'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 {
// this can potentially be handled by a Drupal sub class
$this->setProperty('profile', 'standard');
$this->setProperty('install_method', 'profile');
}
/**
......
......@@ -89,21 +89,23 @@ function drush_provision_drupal_provision_install() {
// Install site according to install_method.
drush_log(dt('Installing site with the "!method" method.', array(
'!method' => drush_get_option('install_method', 'profile'),
'!method' => d()->install_method,
)), 'ok');
// Run Drupal installation if option was specified
if (drush_get_option('install_method', 'profile') == 'profile') {
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');
}
elseif (drush_get_option('install_method', 'profile') == 'manual') {
// If install_method is 'manual', do nothing.
elseif (d()->install_method == 'manual') {
drush_set_option('login_link', 'http://' . d()->uri . '/install.php');
}
......
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