1 / 18

Optimize Site Deployments with Drush

Optimize Site Deployments with Drush. Saturday, 2011.11.12 – Drupal Camp Toronto 2011 Jon Peck, Owner, FluxSauce.com Audience: Intermediate. Revision 2. Who am I?. Jon Peck Founded web application development firm FluxSauce Zend Certified PHP Engineer Web development since 1998

daria
Download Presentation

Optimize Site Deployments with Drush

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Optimize Site Deployments with Drush Saturday, 2011.11.12 – Drupal Camp Toronto 2011 Jon Peck, Owner, FluxSauce.com Audience: Intermediate Revision 2.

  2. Who am I? • Jon Peck • Founded web application development firm FluxSauce • ZendCertified PHP Engineer • Web development since 1998 • Used Drupal for the last three years

  3. Overview • Why should you script site deployments? • What are drush and drush make, and how can you use them? • What are features, and does it fit your needs? • What are some recommended site deployment strategies? • How can you develop your own strategy?

  4. Why script site deployments? • Reliability • Track changes over time (including blame) • Support multiple tiers • Manage and optimize your operations "Aaahhh!!!", CC BY 2.0 by Evil Erin @ flickr

  5. What is drush? drushis a command line shell and scripting interface for Drupal.

  6. What can you use drush for? • Manage modules • Manage users • Execute Drupal commands • Manipulate and extract site variables • Execute MySQL queries using Drupal config

  7. What is drush make? A standard recipe for downloading everything you need for a site installation.

  8. Three steps for deployment • Get the files (drush make)drush-y make --no-patch-txt "PATH/drush.make" FOLDER • 2. Install and configure (drush)cd FOLDERdrush-y site-install --config="PATH/drushrc.ENV.php” • 3. Enable modules (drush)drush-y en \admin_menu\ctools \...

  9. Scripting site deployments • Drupal Deployment Skeleton (MIT license) • http://goo.gl/09JkE (gitHub) • /projects/NAME/config- stored in repository • drush.*.php • drush.make • config.ini • install.sh • setup.sh • rebuild.sh

  10. What is the features module?

  11. What can you use features for? • Within your site (GUI) • Leveraging drush (command line)

  12. What are features’ limitations? • Imperfect exports • No site variables without third-party modules • No theme, block support • No control logic • If you can't do it in the GUI... "40+296 Hello?", CC BY 2.0 by Bark @ flickr

  13. Custom modules for granular control With hook_install(), you can programmatically… • Create users, roles, permissions • Create and hide blocks • Create content (nodes) • Import content types / CCK • Create vocabularies and terms (fields) • Set site variables (drushvget) • Import views

  14. Custom module “gotchas” • Custom modules used like this need a user associateddrush-u 1 -y en custom_module • Clear all caches after installing your custom moduledrushcc all • Changes and updates need to go in hook_update_N within your module

  15. Deployment strategies • Store everything in a versioning system • Always backup both your scripts and database first! • Tiered development strategy • Unique database credentials for each tier • When in doubt, rebuild on devfirst • Instead of repeating steps, do it in code • Document the process

  16. How can I do this? • Get drush • Get drush_make • Define your needs. • Build and document your module toolbox • Start small, then scale up

  17. "Question mark in Esbjerg", CC BY-SA 2.0 by Alexander Drachmann @ flickr Questions? Note: I have not used these techniques with Apache Ant or phpUnderControl.

  18. Thank you! • drush • http://drupal.org/project/drush • drush_make • http://drupal.org/project/drush_make • Drupal Deployment Skeleton (DDS) • http://goo.gl/09JkE (gitHub) • drush make Generator • http://drushmake.me • permissions_api • http://drupal.org/project/permissions_api • Traditional Development... Practice for Software Development • http://dltj.org/article/software-development-practice jpeck@fluxsauce.com@FluxSaucehttp://fluxsauce.com

More Related