Depolying Drupal with Git, Drush Make and CapistranoPresentation Transcript
Deploying Drupalwith Git, Drush Make, and Capistrano chad fennell
whoami• web developer• U of MN Libraries• email@example.com• drupal.org: cfennell• twitter: chad__fennell
What is this all about?
Software Deployment“Software deployment is all of the activitiesthat make a software system available foruse.”http://en.wikipedia.org/wiki/Software_deployment
Take Many Small Risks Frequent Releases Small Releases with A Safety Line (e.g. Rollback)
“In software, when something is painful, theway to reduce pain is to do it more frequently,not less.” - Jez Humble, David Farley Continuous Delivery
Automated Deployments Are...• Free of PEBKAC/manual errors• Repeatable/shareable and therefore debuggable• Documented • Repeatable + documentation = collaboration• Testable, as in Continuous Integration• Time savers for your top earners, developers• A way to dramatically lower “cycle time” - Jez Humble, David Farley Continuous Delivery
Great, will this ﬁx my code? Nope.
“A working software application can beusefully decomposed into four components:executable code, conﬁguration, hostenvironment, and data.” - Jez Humble, David Farley Continuous Delivery
cap-drupal, a modest ﬁrst step ✓ Executable Code: git ✓ Conﬁguration: Capistrano (sort of) ...talk to me after Drupal 8 Host Environment: git, Chef?, Puppet? TBD Data: Backup and Migrate + cap-drupal? - Jez Humble, David Farley Continuous Delivery
“...you needn’t automate everything at once” - Jez Humble, David Farley Continuous Delivery
cap-drupal components Manage Module, Library and Theme Code Manage the Site Build Automate Some of the Things
Why use Git?• Stability • Created by Linus Torvalds in 2005 for Linux kernel development.• (Crazy) Speed• Popularity• Design• Why I chose Git - Aristotle Pagaltzis• http://plasmasturm.org/log/487/
Drush“Drush is a command line shell and scriptinginterface for Drupal, a veritable Swiss Armyknife designed to make life easier for thoseof us who spend some of our working hourshacking away at the command prompt.”e.g. $ drush dl drupal
Drush Make“Drush make is an extension to drush thatcan create a ready-to-use drupal site,pulling sources from various locations. Itdoes this by parsing a flat text file (similarto a drupal .info file) and downloading thesources it describes. In practical terms,this means that it is possible todistribute a complicated Drupaldistribution as a single text file.”http://drupal.org/project/drush_make
Drush Make• Build with a single command $ drush make foo.make
Drush Make Highlights• Drush Make files are “Versionable”• Build with a single command • $ drush make foo.make --working-copy • Preserves .git and .svn directories• Caches downloads locally • ~/.drush/cache/downloads • ~/.drush/cache/git• Downloads in parallel• SCM agnostic (e.g. vs git submodules)• Part of Drush (5)
Capistrano"Capistrano is a developer tool for deployingweb applications. It is typically installed on aworkstation, and used to deploy code fromyour source code management (SCM) to one,or more servers."https://github.com/capistrano/capistrano/wiki/Documentation-v2.x
Why Capistrano, isnt that,like, Rails, man?? A Common Scenario: Start with manual deployment, then automate a few things with bash, then the the bash scripts become complex, and then find your way to a deployment tool. ...and Capistrano was simple...