Mark Dorison

Creating a new Drupal site from a Drush make file

If you spend a fair amount of time creating new Drupal sites and are not using Drush you are missing out! I used to maintain a subversion repository with my most frequently used modules just for this purpose but this was a very tedious, manual task keeping these modules up to date (almost more trouble than it was worth). With Drush Make however, you can just fire it off, and right before your eyes, you will have a brand new directory with the latest versions of all the modules you specified, downloaded and ready to go.

From Drush make's project page:
> Drush make is an extension to drush that can create a ready-to-use drupal site, pulling sources from various locations. It does this by parsing a flat text file (similar to a drupal .info file) and downloading the sources it describes. In practical terms, this means that it is possible to distribute a complicated Drupal distribution as a single text file.

Below is an example Drush make file.

core = 6.x
projects[] = drupal

; acquia
projects[admin_menu][subdir] = "acquia"
projects[cck][subdir] = "acquia"
projects[filefield][subdir] = "acquia"
projects[imageapi][subdir] = "acquia"
projects[imagecache][subdir] = "acquia"
projects[imagefield][subdir] = "acquia"
projects[pathauto][subdir] = "acquia"
projects[token][subdir] = "acquia"
projects[views][subdir] = "acquia"
projects[webform][subdir] = "acquia"

; administration
projects[password_strength][subdir] = "other"
projects[userprotect][subdir] = "other"

; development
projects[coder][subdir] = "other"
projects[devel][subdir] = "other"

projects[zen][subdir] = "other"

I have shown the example above to illustrate the make file syntax. This example is a bit more lean, module-wise, then even my bare bones make file is. I have separated out the modules contained in the Acquia distribution, of which I am a big fan of, but this is just for organization's sake.

Once you have created the make file that you are going to use you can implement it with the following command:
drush make "path_to_make_file" /path_to_newsite_/

I have published a standard and a bare-bones make file on GitHub. Please feel free to fork with your changes/additions!

Links of note:

← Home