summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Rossouw2010-06-18 05:13:27 (GMT)
committerAdrian Rossouw2010-06-18 05:13:27 (GMT)
commit516a06e2bd13aaf3636c9ce5c8c20eeaf3fdd8db (patch)
treeac961b9f18ffb8098e2331ca9b3f71442be98022
parent144ef6337b41e6b8e67ddacabf362fb63e17d42f (diff)
Create a new hidden provision-install-backend command, that we call during provision-install, so we can isolate php errors and recover from them. should also help with OOM errors.
-rw-r--r--platform/install.provision.inc25
-rw-r--r--platform/provision_drupal.drush.inc8
-rw-r--r--provision.drush.inc7
3 files changed, 24 insertions, 16 deletions
diff --git a/platform/install.provision.inc b/platform/install.provision.inc
index 071ec3c..7a96629 100644
--- a/platform/install.provision.inc
+++ b/platform/install.provision.inc
@@ -32,6 +32,14 @@ function drush_provision_drupal_pre_provision_install() {
}
/**
+ * If the install went south, and the site is not PROVISION_SITE_INSTALLED, clean up behind ourselves
+ */
+function drush_provision_drupal_pre_provision_install_rollback() {
+ _provision_recursive_delete( d()->site_path );
+}
+
+
+/**
* Install Drupal with the pre-configured settings, by calling an external script
*
* This is an external script so that php is running in it's own namespace, and
@@ -42,26 +50,13 @@ function drush_provision_drupal_provision_install() {
provision_prepare_environment();
_provision_drupal_create_settings_file();
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
-
- drush_include_engine('drupal', 'install');
+ provision_save_site_data();
+ provision_backend_invoke(d()->name, "provision-install-backend");
drush_set_option('installed', TRUE, 'site');
_provision_drupal_maintain_aliases();
}
/**
- * If the install went south, and the site is not PROVISION_SITE_INSTALLED, clean up behind ourselves
- */
-function drush_provision_drupal_provision_install_rollback() {
- if (d()->uri) {
- if (!drush_get_option('installed', FALSE)) {
- _provision_recursive_delete( d()->site_path );
- }
- } else {
- drush_set_error('PROVISION_FRAMEWORK_ERROR', dt('no url defined in %function', array('%function' => __FUNCTION__)));
- }
-}
-
-/**
* Finish the installation, regenerate the caches on the site so that
* any changes to things such as available modules/ themes can take affect.
*/
diff --git a/platform/provision_drupal.drush.inc b/platform/provision_drupal.drush.inc
index 15b04ed..6b3a199 100644
--- a/platform/provision_drupal.drush.inc
+++ b/platform/provision_drupal.drush.inc
@@ -87,6 +87,14 @@ function _provision_drupal_site_exists() {
}
/**
+ * This command does the actual installation in it's own thread,
+ * so we can recover gracefully if things go really wrong.
+ */
+function drush_provision_drupal_provision_install_backend() {
+ drush_include_engine('drupal', 'install');
+}
+
+/**
* Sync the current Drupal platform and, if applicable, site. Call after
* finishing operations that affect the filesystem.
*/
diff --git a/provision.drush.inc b/provision.drush.inc
index 034b339..52ca751 100644
--- a/provision.drush.inc
+++ b/provision.drush.inc
@@ -82,11 +82,16 @@ function provision_drush_command() {
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
);
$items['provision-install'] = array(
- 'arguments' => array('domain.com' => dt('The domain of the site to install.')),
'description' => dt('Provision a new site using the provided data.'),
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
+ $items['provision-install-backend'] = array(
+ 'description' => dt('Provision a new site using the provided data.'),
+ 'hidden' => TRUE,
+ 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_SITE
+ );
+
$items['provision-import'] = array(
'arguments' => array('domain.com' => dt('The domain of the site to import.')),
'description' => dt('Turn an already running site into a provisioned site.'),