Drush Make - Drupal Distributions Packaging Automation Tool

Last modified: November 6, 2009 - 09:00

Drush Make is provided as an extension to Drush, the command line tool for Drupal (or follow this link to the Drush handbook page for more information on how to use Drush itself).

Project page: http://drupal.org/project/drush_make

What Drush Make does is, through the implementation of flat files (similar in appearance to .info files from modules), provide a mechanism to fetch data from practically any source you tell it to, and package it. This includes downloading Drupal core as well as other contributed modules available on drupal.org.
It also provides the ability to fetch:

  • code from CVS repos, including tag-specific
  • ditto for svn
  • ditto for git, including checking out a particular branch after cloning the repo
  • grabs .tar.gz stuff, wget-style - useful for libraries
  • can fetch and apply patches

The package created can then be used for distribution or as a platform build that can then be then deployed and instancified/cloned using the Aegir hosting system.

A typical Drush make file could look something like the following:

my_own_distribution.build

core = 6.x
projects[] =  drupal
projects[my_own_distribution][type] = "profile"
projects[my_own_distribution][download][type] = "git"
projects[my_own_distributiont][download][url] = "git@git.example.com:/drupal/profiles/my_own_distribution"
projects[my_own_distribution][download][branch] = "build_2009101601"

Execute using:

Drush make [build file].build [target]
Eg: Drush make my_own_distribution.build /var/aegir/drupal-6.14_build_2009101601

Drush is also capable of recursing through the content defined in the make file and, if found, execute other included make files. This makes for a flexible and expandable build system where packages can be expanded using already available build files.

Using the previous my_own_distribution.build example, one could have the following make file tucked inside the my_own_distribution profile:

my_own_distribution.make

core = 6.x
projects[] = admin_menu
projects[] = pathauto
projects[] = token
projects[] = views
projects[] = cck

This would also fetch and add the above modules, from Drupal.org module repository, and package them with the profile and Drupal core.

Related content:

  • An article describing the combined usage of Drush Make, Aegir and version control for deploying Drupal projects.
 
 

Drupal is a registered trademark of Dries Buytaert.