How Drush Make Just Changed My Life

Photo of Greg Harvey
Thu, 2010-01-28 11:18By greg

Note: Apparently it works fine with Windows too! See comments.

I'm pretty excited right now. I just tried drush make for the first time. Download it here:

That's an order! You'll need drush too, if you don't have it yet (in which case, shame on you ... call yourself a Drupal developer?!)

Install it (the README instructions are nice and clear). Now what? Make a make file. Again, the README is pretty clear. Here's my "standard" make file, but I intend to make a "commerce" file, "services" file, "flash support" file, "social sites" file, etc. Anyway, the file:

core = 6.x

projects[] = drupal

projects[cck][subdir] = "contrib"
projects[filefield][subdir] = "contrib"
projects[imagefield][subdir] = "contrib"
projects[link][subdir] = "contrib"
projects[email][subdir] = "contrib"
projects[date][subdir] = "contrib"

projects[vertical_tabs][subdir] = "contrib"
projects[better_formats][subdir] = "contrib"
projects[imce_wysiwyg][subdir] = "contrib"
projects[imce][subdir] = "contrib"
projects[wysiwyg][subdir] = "contrib"
libraries[tinymce][download][type] = "get"
libraries[tinymce][download][url] = ""
libraries[tinymce][directory_name] = "tinymce"

projects[admin_menu][subdir] = "contrib"
projects[adminrole][subdir] = "contrib"
projects[masquerade][subdir] = "contrib"
projects[taxonomy_manager][subdir] = "contrib"
projects[backup_migrate][subdir] = "contrib"

projects[views][subdir] = "contrib"
projects[imagecache][subdir] = "contrib"
projects[imageapi][subdir] = "contrib"
projects[token][subdir] = "contrib"
projects[logintoboggan][subdir] = "contrib"
projects[webform][subdir] = "contrib"

projects[blocktheme][subdir] = "contrib"
projects[zenophile][subdir] = "contrib"

projects[boost][subdir] = "contrib"

projects[pathauto][subdir] = "contrib"
projects[globalredirect][subdir] = "contrib"
projects[nodewords][subdir] = "contrib"
projects[page_title][subdir] = "contrib"
projects[xmlsitemap][subdir] = "contrib"

projects[zen][subdir] = "contrib"
projects[fusion][subdir] = "contrib"
projects[clean][subdir] = "contrib"
projects[rootcandy][subdir] = "contrib"
projects[seven][subdir] = "contrib"

Save it as standard.make. Make a new directory. Go there in a terminal window. Type drush make /path/to/standard.make then go make a cup of tea. Come back, go to your new site, run through the installer. Done! New Drupal site with all your desired contrib pre-installed. =)

I particularly like the way it can fetch 3rd party stuff (note the TinyMCE download - you could also use it to fetch all the players for SWF Tools, for example).

Of course, now you can actually run this from a Linux shell script. I don't think it's possible to script a generic installation with drush (yet!) but it *is* possible to use drush, post install, to enable everything. And come Drupal 7 you could have a Linux shell script that goes something like this:

# get core and contrib
drush make ~/workspace/core/makefiles/standard.make
# install Drupal
drush ic
# enable modules
drush en cck filefield views imagefield imagecache imageapi path ...

You get the idea. So no more box-ticking on the modules page either. You can do the above with Drupal 6, but you'll need Aegir, and that's a whole other story!

I think I need to lie down.