Spent some time over the past few days setting up a drush makefile.
Drush is the Drupal Shell, and if you’re not using it you should be. Drush MAKE is a great function -- It creates a website pre-loaded with the themes and modules you prefer with a single command. All you have to do afterward is enable the ones you want – and you can do that also from Drush.
Setting up a makefile isn’t difficult, but there are a couple of tricks. And the docs don’t explain them well. Here’s what you need to know…
Start out with a fresh install of Drupal. This will become the model for your makefile and the sites you create with it. Using Drush, download the modules and themes you want to include in your site load. The procedure is simple: cd into your site (you do not have to be in the module or themes directory). Use the Drush download command to add themes and modules.
The syntax is simple: drush dl name_of_module_or_theme. It will drop the module or theme into the correct directory. Make certain that all of your modules are for the correct release of Drupal. Drush will automatically get the latest stable release of each module, but if you ask for a Drupal 6 module, Drush will happily add it to your Drupal 7 load. And Drupal won’t be a happy camper. To fix this, you have to delete the out-of-synch module from the directory, flush the caches and reload the module page from inside Drupal.
Once you’ve got all the modules and themes loaded in your base build, it’s time to fire up your site. Create your database and launch Drupal. Now for the fun part: Go to your modules page, and load ALL of the modules. If a module isn’t loaded, Drush won’t see it in the database, and won’t add it to your makefile.
If you’ve got a bunch of modules, load them in stages. There is a memory limitation on the loading of modules, and if you exceed it, you’ll get the infamous white screen. All might not be lost if you get the white screen, so just move on to the next step.
Return to your shell. Change directory to the root of your Drupal site. Run the following command: drush generate-makefile name_of_file.make. This will create the makefile in the current directory.
Now open the file with a text editor (VI, TextWrangler, BBEdit or similar). You should see something like this:
; This file was auto-generated by drush make
core = 7.x
api = 2
projects[drupal][version] = "7.x"
; Modules
projects[admin_menu][version] = "3.0-rc3"
projects[module_filter][version] = "1.7"
; Themes
projects[clean][version] = "1.x-dev"
projects[corporate][version] = "1.5"
projects[corporateclean][version] = "1.5"
projects[marinelli][version] = "3.0-beta11"
projects[om][version] = "2.21"
projects[om_admin][version] = "2.2"
projects[responsive_blog][version] = "1.3"
projects[zen][version] = "5.1"
Check to make sure that all the modules and themes you want in your baseload are listed. If something is missing, you can add it manually. You could make the entire file manually, but it’s less work to do it through Drupal and Drush.
Once you’ve got a good makefile, make a copy and put it in a safe location. To create a new Drupal instance using the makefile, place a copy of it in your htdocs directory. In Drush, change directory into htdocs, and issue the following command: drush make name_of_make_file.make name_of_site.
Drush will report back in verbose mode on everything it creates.
One note: Drush uses the makefile as a shopping list to download all of the requested modules, themes, and Drupal core itself, so you always get the latest version of Drupal core.
This is a simple approach to using Drush MAKE. For notes on more advanced usage, see http://drupal.org/node/1006620

Comments
There is an issue with drush make file on 5.7 Windows
All,
Drush make files may not work on Windows 7 machines. There is an open issue in the Drush issue queue discussing this issue.
If you are on windows running drush 5.7 and it is not working, you might want to read this and subscribe to the issue. The more people on the list, the better. This helps the maintainer know there is a large issue out there.
Dennis
the obvious answer
switch to OS X -- or Linux
tk
May have to if MS stays the Windows 8 direction.
Mac X - pay twice as much for the same stuff. does not seem very smart.
Linux - definite maybe.
OSX Very Smart
Dennis, yes a Mac might cost twice as much or even 3x, but keep in mind that ultimately, spending (wasting?) time troubleshooting Windows costs time which equals $$$. Ever since I converted to Mac last year, my productivity has increased greatly because OSX just works. I will gladly pay the premium to keep my blood pressure down by not having to constantly fight with Windows :-)
JCL
This is the old Ford vs Chevy debate
Hi,
I've not had the problems other people have had with Windows. I've been on Mac's before and just did not like them. My productivity when down instead of up.
As you said, I have found that Windows 2000, XP, and 7 just work. I stayed away ME, Vista, and any Windows release prior to SP1. So, for me, I don't see the need to spend the extra money because I've not had to fight Windows. But then again, I spent many years on DOS and have been on windows since Windows 2.0 - as ugly as it was.
So the Mac vs Windows is another personal choice. Just like Chevy versus Ford, God versus atheist, Obama vs Romney. My choice has been Windows. Your choice is a Mac. Given Windows 8, my next choice is probably going to be Unbuntu.
The Mac is a good product. The support options are much better than Windows. But for me, I don't see the cost justifications. Obviously you do.
Dennis
What is the benefit to
What is the benefit to specify the version of a module? I use my .make file only for modules that I use in most every single site and I will always want the most stable version. If there is a module that I need in beta then I dl and en separately, not put it in a make file.
Your example:
projects[admin_menu][version] = "3.0-rc3"
projects[module_filter][version] = "1.7"
When the version is not specified, drush will always download the most current stable version of a module.
My example:
projects[] = admin_menu
projects[] = module_filter
Some versions of some modules
Some versions of some modules introduce incompatibilities. The latest stable release of two modules can sometimes put you worse off than if you had two specific older versions and/or dev versions of these modules. If you run into one of these pairings, it's good to just put it in your makefile and not have to re-work out which versions work with which. Exceptions to this are, of course, if patches are available and can be added to your makefile and/or this makefile has become obsolete due to committed fixes.
--
Digital Frontiers Media
You can also specify modules
You can also specify modules that don't even have a release like this:
projects[corporateclean][download][type] = "get"projects[corporateclean][download][url] = "http://ftp.drupal.org/files/projects/corporateclean-7.x-1.1.tar.gz"
And you can grab modules form a git repo like this:
projects[cacheflusher][download][type] = "git"projects[cacheflusher][download][url] = "git://git.drupal.org/sandbox/bhosmer/1170266.git"
projects[cacheflusher][type] = "module"
Thank you, that makes sense.
Thank you, that makes sense. What is the standard "best practice" for make files? So far, I only have the very basic modules needed. I am new and do not want to make initial bad decisions that turn into bad habits.
I'm not sure if there is a
I'm not sure if there is a standard really. I guess it is whatever works for you.
This is my collection. I have a commerce branch too that I use just for Drupal Commerce. Some of the modules in my make file probably have stable releases now, like the media module so I should probably update it.
problems running drush make on Vagrant/VirtualBox
Hello,
I installed Vagrant server using Jeff Eaton's chef script found here: https://github.com/eaton/vagrant-chef-dlamp
It works on Windows 7. Everything works in Windows 8, except for Drush make. I'm running a DLAMP stack under VirtualBox. I can use drush to download and install Drupal 7, but the drush make files return the error message: could not located drupal version 7.
Any advice?
Katy
www.seascapewebdesign.com
Katy Laan, Senior Web Developer
SeascapeWebDesign.com
Seascape Web Interactive
Follow us on Twitter
Hi, I am facing the issue on
Hi,
I am facing the issue on Windows 7 with drush make command.
Below is the command -
drush make drupal7new.make drupal7makeOutput of the command -
C:\Users\USERNAMe~1\AppData\Local\Temp/drush_tmp_1364289832_51516928eb18a/x
drupal-7.18 is not readable or does not exist.
Project drupal (7.18) could not be downloaded to C:\Users\Username [error]
Patil\AppData\Local\Temp\make_tmp_1364289832_5151692898edd/build.
>> zen-7.x-5.1 downloaded. [ok]
>> webform-7.x-3.18 downloaded. [ok]
>> Project views contains 2 modules: views, views_ui.
>> token-7.x-1.5 downloaded. [ok]
>> views-7.x-3.6 downloaded. [ok]
>> pathauto-7.x-1.2 downloaded. [ok]
>> Project entity contains 2 modules: entity, entity_token.
>> Project date contains 11 modules: date_views, date_tools, date_repeat_field,
date_repeat, date_popup, date_migrate_example, date_migrate, date_context, date
_api, date_all_day, date.
>> entity-7.x-1.0 downloaded. [ok]
>> date-7.x-2.6 downloaded. [ok]
>> Project ctools contains 9 modules: views_content, stylizer, page_manager, ct
ools_plugin_example, ctools_custom_content, ctools_ajax_sample, ctools_access_ru
leset, bulk_export, ctools.
>> ctools-7.x-1.2 downloaded. [ok]
>> Project admin_menu contains 3 modules: admin_menu_toolbar, admin_devel, admi
n_menu.
>> admin_menu-7.x-3.0-rc4 downloaded. [ok]
>> Project views_bulk_operations contains 2 modules: actions_permissions, views
_bulk_operations.
>> views_bulk_operations-7.x-3.1 downloaded. [ok]
Please help me on this issue.
Thanks
I am facing the issue on
Can you please post the text of your make file?
Below is the .make file code
; This file was auto-generated by drush make
core = 7.x
api = 2
projects[drupal][version] = "7.x"
; Modules
projects[views_bulk_operations][version] = "3.1"
projects[admin_menu][version] = "3.0-rc4"
projects[ctools][version] = "1.3"
projects[calendar][version] = "3.4"
projects[css_injector][version] = "1.8"
projects[date][version] = "2.6"
projects[entity][version] = "1.0"
projects[entityreference][version] = "1.0"
projects[styles][version] = "2.0-alpha8"
projects[hierarchical_select][version] = "3.0-alpha5"
projects[references][version] = "2.1"
projects[pathauto][version] = "1.2"
projects[support][version] = "1.0-rc2"
projects[token][version] = "1.5"
projects[views][version] = "3.7"
projects[webform][version] = "3.18"
; Please fill the following out. Type may be one of get, git, bzr or svn,
; and url is the url of the download.
projects[customizations][download][type] = ""
projects[customizations][download][url] = ""
projects[customizations][type] = "module"
problem with Drush make
After I run the drush make command, i don't know where to find the Drupal prject and all its modules. I am getting error messages at the folder "C:\Users\myMachine\AppData\Local\Temp\drush_tmp_1364397410_51530d62e7df1".
don't know where all the files/folders are sitting and how to build the site now.
Need some help - thanks
Drush will try to create the
Drush will try to create the new site in in your present working directory. And it will prompt you "do you want to create the site in the current working directory?"
What kind of error messages are you getting?
tk
Thanks for your
Thanks for your reply.
Actually the make file i use has several other make files and after running the command, they are saved in multiple folders in "C:\Users\myMachine\AppData\Local\Temp\drush_tmp_xxxx1", drush_tmp_xxxx2, drush_tmp_xxxx3, drush_tmp_xxxx4,
I thought it will save the site in my xampp/htdocs/stitename but it doesn't.
The errors I am getting are;
Unable to patch fserver with 17.......
Unable to patch feeds_et with...........etc, etc
Do i need to specify the directory in my make command?
Is there a condition on the
Is there a condition on the order of the modules listed in the make file? When I write my make file should I put the contrib modules and libraries in a specified order?