How to create a site in Acquia Dev Desktop from a .yaml makefile

Did you know that with a single drush command, you can create a new drupal site with any modules or themes you want? The command is 'drush make' and it accepts 2 arguments: 'makefile' and 'buildpath'. All you need to get started is a working installation of Acquia Dev Desktop which you can get here.

Okay let's get started

Step 1: Making the makefile

The first thing you'll need to do is to create a makefile. A makefile is basically a text document (similar to a .info file) that drush will read and use a list of ingredients for your new site. Up to now, drush has only been able to read makefiles in a single format. However, with the latest release of drush 7, drush can also create sites from files in .yaml format. (Full disclosure: I don't know what the advantage is of using .yaml file, but the point is, if you're more familiar with .yaml, you can now use that file format to create a makefile for drush.) If you would like to compare the differences between the file fomats, there are examples of each of them in the Acquia Dev Desktop application folder (/Applications/DevDesktop/drush/vendor/drush/drush/examples).

If you already have a site that includes all the modules and themes that you'd like to use in future sites, you can use drush to create a makefile by executing the command drush generate-makefile example.make, or you can write your own makefile following the format used in the examples.

Step 2: Creating a new site using the makefile

Okay, so now that you have your makefile, all you need to do is execute the drush make command. There are a handful of options that can be specified when executing this command, which you can read about here.

The only 2 required arguments are the makefile and the buildpath (the directory where you want the new docroot to be).

So here's the code: drush make yourmakefile.yaml path/to/docroot

Then just navigate to your new site docroot in a browser window and follow the instructions in the UI to complete setting up your new site.

Topics: