Commit 3527dd30 authored by mig5's avatar mig5

Issue #1205956 by helmo - Document the Provision API

parent 91efa9c7
......@@ -17,6 +17,8 @@
/**
* Make sure we have a valid site being deployd, and that the file being deployd from exists
*
* Implementation of drush_hook_COMMAND_validate().
*/
function drush_provision_drupal_provision_deploy_validate($backup_file = null) {
$exists = provision_file()->exists($backup_file)
......@@ -44,6 +46,8 @@ function drush_provision_drupal_provision_deploy_validate($backup_file = null) {
/**
* Make a backup before making any changes, and add extract the file we are restoring from
*
* Implementation of drush_hook_pre_COMMAND().
*/
function drush_provision_drupal_pre_provision_deploy($backup_file) {
// the url is likely to have changed in the deployment
......@@ -117,6 +121,8 @@ function drush_provision_drupal_pre_provision_deploy($backup_file) {
/**
* Remove the extracted site directory
*
* Implementation of drush_hook_pre_COMMAND_rollback().
*/
function drush_provision_drupal_pre_provision_deploy_rollback() {
if (drush_get_option('deploy_replace_site', FALSE)) {
......@@ -140,11 +146,17 @@ function drush_provision_drupal_pre_provision_deploy_rollback() {
}
}
/**
* Implementation of drush_hook_COMMAND().
*/
function drush_provision_drupal_provision_deploy() {
_provision_drupal_maintain_aliases();
_provision_drupal_create_directories();
}
/**
* Implementation of drush_hook_post_COMMAND().
*/
function drush_provision_drupal_post_provision_deploy() {
// call the drush updatedb command.
provision_backend_invoke(d()->name, 'updatedb');
......
......@@ -6,6 +6,8 @@
/**
* Make sure we have a valid site being migrated, and that the file being migrated from exists
*
* Implementation of drush_hook_COMMAND_validate().
*/
function drush_provision_drupal_provision_migrate_validate($platform = NULL) {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
......@@ -13,6 +15,8 @@ function drush_provision_drupal_provision_migrate_validate($platform = NULL) {
/**
* Make a backup before making any changes, and add extract the file we are restoring from
*
* Implementation of drush_hook_pre_COMMAND().
*/
function drush_provision_drupal_pre_provision_migrate($platform, $new_uri = NULL) {
/* Set offline mode to true and re-generate the settings.php. This will write a
......@@ -45,6 +49,8 @@ function drush_provision_drupal_pre_provision_migrate($platform, $new_uri = NULL
/**
* Remove the extracted site directory
* Restore the vhost conf per the original platform
*
* Implementation of drush_hook_pre_COMMAND_rollback().
*/
function drush_provision_drupal_pre_provision_migrate_rollback($platform, $new_uri = NULL) {
// Set site_offline to false and regenerate the config
......@@ -61,6 +67,8 @@ function drush_provision_drupal_pre_provision_migrate_rollback($platform, $new_u
/**
* Switch the migrate directories around now that we have the new db installed
*
* Implementation of drush_hook_COMMAND().
*/
function drush_provision_drupal_provision_migrate($platform, $new_uri = NULL) {
......@@ -101,6 +109,8 @@ function drush_provision_drupal_provision_migrate($platform, $new_uri = NULL) {
/**
* Something went wrong
*
* Implementation of drush_hook_COMMAND_rollback().
*/
function drush_provision_drupal_provision_migrate_rollback($platform) {
drush_backend_invoke_args('provision-save', array(d()->name), array('platform' => drush_get_option('old_platform'), 'root' => NULL, 'uri' => NULL));
......@@ -108,6 +118,8 @@ function drush_provision_drupal_provision_migrate_rollback($platform) {
/**
* Delete the old site directory and recreate the settings file
*
* Implementation of drush_hook_post_COMMAND().
*/
function drush_provision_drupal_post_provision_migrate($platform, $new_uri = NULL) {
drush_set_option('installed', FALSE);
......
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