Skip to content

Instantly share code, notes, and snippets.

@keopx
Last active October 27, 2015 02:00
Show Gist options
  • Save keopx/9d83a9698558560c42b0 to your computer and use it in GitHub Desktop.
Save keopx/9d83a9698558560c42b0 to your computer and use it in GitHub Desktop.
Drupal Deploy process using hook_update_N on custom module for deploy
function demo_deploy_update_7001() {
# Reverting a feature should not be done in the visual interface
# or using drush fr, but should rather be done in the hook_update_n().
# To determine the component name (example views_view), make sure you are
# using version 2.x of Features, and visit the page for your features.
# In parentheses you will see the machine name for each component.
features_revert(array(
'demo_feature' => array(
'views_view',
),
));
module_enable(array(
'new_module'
));
}
@swirtSJW
Copy link

This helper module for D7 takes your deploy strategy one step farther and provides both feedback and the possibility of failing an update if what was attempted, did not work
https://www.drupal.org/project/hook_update_deploy_tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment