Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Drush recipes cookin' up sweet beta eats!

Parent Feed: 

Drush Recipes has come a long way since the project was first announced on planet a month ago.

Highlights of Beta

  • Testing, a lot a lot a lot of testing
  • Travis CI - We’ve passed our own builds in our latest testing of beta4 against php 5.3, 5.4, 5.5 and HHVM
  • Multiple contributors, including a junior developer currently dedicated to QA / Travis
  • Multiple camp presentations to elicit feedback, all of which was incorporated into the project
  • Production usage - ELMSLN now includes Drush recipes and implements the dr_safe_upgrade script
  • Documentation - Below is a playlist that documents each command and options you can use in these commands
  • Additional recipes added from real world usage and community feedback

Work is currently underway to build a Drupal site development wizard (based on puphpet) that will use drush recipes to ask a developer a series of questions and start building a site with all the functionality that they request. This is a fundamentally different way of building a Drupal site that can easily be captured, transferred to another developer and be deployable more easily.

Yes we haven’t solved features entirely, but we’re getting there in many of the sticky areas (like permissions and roles). Using the included ddt function you can take a finished site and turn it into a recipe to give to someone else though. For example, the command below will take a Drupal site and turn it into the http://drush.recipes/ web service (alpha).

drush cook http://drush.recipes/sites/default/files/recipes/drecipe_uploads/drush_r...

Documentation

This playlist illustrates all the commands that are now linked to on the drush recipes project page.

ELMSLN / Production usage

My work on ELMSLN is what’s inspired drush recipes. I started writing a lot of drush commands in succession against different, well structured aliases. As I started to write YABS (yet another bash script) I noticed that I was doing things that I imagined everyone was doing; running a series of commands to get stuff to happen in a pattern. These patterns exist everywhere, and when used together, they have meaning. dr_safe_upgrade.drecipe was the first recipe that I made by hand which does registry rebuild, takes a site offline, runs updates, brings it back up, clears caches, runs cron, and then seeds entity caches.

It was a simple series of commands that originally appeared in a script I was writing for ELMS learning network to spider the network and upgrade all systems. As you can see, this script was doing a lot of drush calls against the different parts of ELMSLN that it was self-aware of. Now, we have one drush call instead of several spread across multiple lines. This lead to a 100 line reduction in bash scripting while providing a stable upgrade drush routine that can be applied to any Drupal site ever created!

Just look at the commit that pushed drush recipes into usage in this script. All the red lines are code that was removed, while green code was additions. This removed 97 lines from the file while only adding 4!

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web