Your SlideShare is downloading. ×
The Basics of Smart Drupal Deployment
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

The Basics of Smart Drupal Deployment


Published on

Published in: Technology, Sports
  • Thanks, great! Another good practice is using Features modules and Drush, I'm planning to attend the webinar on this topic, you may find it interesting as well (
    Are you sure you want to  Yes  No
    Your message goes here
  • Nice to know I am not crazy. This is basically the deployment stategy I've been building for the last year or so at Penn State Harrisburg.
    Are you sure you want to  Yes  No
    Your message goes here
  • this is GREAT! so rare to see images which explain version control.
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. The Basics of Smart Erik Webb @erikwebb Drupal Deployment
  • 2. Background• Technical Consultant at Acquia• Focus on best practices, infrastructure, and developer training• Working with Drupal ~3.5 years• Previously Red Hat sysadmin at Georgia Tech and application developer at IBM
  • 3. Defining Deployment
  • 4. What is deployment?• Maintaining multiple, independent environments• Effortlessly migrating and testing changes between them• Safely updating without downtime or rollbacks• Accounting for changes in a sustainable way
  • 5. 3.5 Environments• Production • Local • Hands-off • Match software versions• Staging • IDE-focused • Sign-off• Development • Integration
  • 6. The 3 Cs (and an F)• Code only moves up• Configuration lives only in code• Content only moves down• Files only move down
  • 7. Version ControlStaying out of your own way
  • 8. Using Branches and Tags• Branches • Tags • Dynamic • Static • Ongoing work • Releases • Strategic • Periodic
  • 9. Version Control Workflow
  • 10. Keeping Version Control Sane• Ignore inappropriate files • Uploaded files directory • settings.php• Prevent bad PHP using lint checks• Don’t be afraid to blame!
  • 11. Moving Configuration to CodeTools and techniques
  • 12. Usual Suspects• CTools export • Strongarm • Bulk Exporter • Boxes • Views • UUID • Panels • Node export• Features• Features extra
  • 13. Filling the Void• 80% handled by CTools-like exportables• Non-developers stuck• Most give up on final 20%• Breaks entire flow• Exceptions suck!
  • 14. Update Functions• Built-in Drupal feature• Well understood and supported• Only functional code•
  • 15. Update Functions using Helpers /** * @see forum_enable(). */ function mymodule_update_7000() {   $vocab = array(     name => t(Forums),     machine_name => forums,     description => t(Forum navigation vocabulary),     hierarchy => 1,     module => forum,     weight => -10,   );   $vocabulary = (object) $vocab;   taxonomy_vocabulary_save($vocabulary);   return t(New vocabulary imported.); }
  • 16. Update Functions using SQL /** * @link */ function mymodule_update_7001() {   $pid = db_insert(mytable)     ->fields(array(       col1 => value,       col2 => value,     ))     ->execute();   return t(New row imported.); }
  • 17. Next StepsDeploying like a Pro
  • 18. Deploying via Version Control• Atomic (ACID) • svn update• Tools • Post-commit hooks • Jenkins • Capistrano
  • 19. Drush Deployment• Checkout code from version control • Protect files using ownership• Point web server to new version• drush up• drush cc all
  • 20. Jenkins• “Fancy cron”• Triggered by polling SCM• Integrate deployment with other tools • Selenium • jMeter• Run commands only on success (atomicity)
  • 21. Q&ASlides will be posted on and SlideShareSee more at DrupalCamp SC on June 12, 2011
  • 22. Photo credits• “Advanced Theoretical Physics”, Marvin (PA) on Flickr. photos/55853619@N00/145052885/• “Sugar rush from the cupcake wore off”, slworkin2 on Flickr. http://• “Collision between two engines, Bay of Quinte Railway, ON, 1892”, Musée McCord Museum on Flickr. 25786829@N08/2918567169/• “Square Peg in a Round Hole”, casa.pokayoke on Flickr. http://• “Vacation in my backyard”, mandolin davis on Flickr. photos/43546149@N00/258014588/