How to Download Custom Features in a Make File for Drupal

Submitted by Daniel Henry on 06/06/2013 - 12:23:pm

I spent several days creating a rapid site deploy script and since have made modifications and improvements to get it to where I usually expect my sites to start. While it depends primarily on drush, I started using features to get some of the more easily exportable settings on the site such as a page content type and some WYSIWYG, text filter, and IMCE profiles. The problem is how do I pull features with a drush make file. There were several options such as git repos and creating my own module feed, but I finally settled on this implementation:

  1. ; Features
  2. libraries[page_type_feature][download][type] = get
  3. libraries[page_type_feature][download][url] = http://myfeaturehost.com/sites/default/files/page_type_feature-7.x-1.0.zip
  4. libraries[page_type_feature][destination] = modules/features
  5.  
  6. libraries[input_format_feature][download][type] = get
  7. libraries[input_format_feature][download][url] = http://myfeaturehost.com/sites/default/files/input_format_feature-7.x-1.0-beta2.tar.gz
  8. libraries[input_format_feature][destination] = modules/features

The libraries portion of a make file is intended to drop JavaScript libraries and API’s such as CKEditor into a libraries folder, but it is also the only method that supports the “get” type.

Just create a Vanilla Drupal install with a page node type and a file upload field and you can attach a gzip or zip file of your feature and point the library URL to it.