Installing using drush make, git & profiles

Installing Drupal 7 using drush make, git and... by kiwipion


The goal of this tutorial is to build a personalized version of your own drupal 7 site, which will consist of your selected modules, themes and libraries, Once you have completed this material you will have gained an understanding of

  • Drush Make.
  • Drupal 7 profiles. 


For you to follow these instructions you will need the followng setup on your machine

  • Local environment set up ie MAMP for mac
  • Drush, Drush Make installed. 

And be comfortable in using the command prompt and GIT scm.


Clone the git respository

 git clone mysite

Setup the core, contrib and personal git branches

cd mysite 
git checkout 7.0 
git checkout -b drupal7core --track origin/7.x 
git checkout -b mysitecontrib 
git checkout -b mysitepersonal 
git branches

Ensure you are in the contrib branch before running the drush make & site installation scripts

 git checkout mysitecontrib

Create a profile using these instructions as a reference

Create a mystyles.make file, details are described here

And here's the mysite.make and to save space on Vimeo I'll paste the contents straight onto the mysite.make

; This file was auto-generated by drush_make
core = 7.x
api = 2
; Modules
projects[admin_menu][version] = "3.x-dev"
projects[advanced_help][version] = "1.x-dev"
projects[colortheme][version] = "1.0"
projects[ctools][version] = "1.x-dev"
projects[captcha][version] = "1.x-dev"
projects[devel][version] = "1.x-dev"
projects[diff][version] = "1.x-dev"
projects[entity][version] = "1.x-dev"
projects[entitycache][version] = "1.0"
projects[features][version] = "1.x-dev"
projects[git_deploy][version] = "1.x-dev"
projects[insert][version] = "1.1"
projects[libraries][version] = "2.x-dev"
projects[references][version] = "2.x-dev"
projects[pathauto][version] = "1.x-dev"
; Themes
projects[sky][version] = "1.x-dev"
projects[rootcandy][version] = "1.x-dev"

Additionally you can add these configurations to the bottom of the mytest.into file, which will make the modules enabled on the new site.

; Contrib
dependencies[] = admin_menu
dependencies[] = colortheme
dependencies[] = ctools
dependencies[] = devel
dependencies[] = diff
dependencies[] = entitycache
dependencies[] = features
dependencies[] = insert
dependencies[] = libraries
dependencies[] = pathauto

Installing the site in three steps

  1. Run the drush make script from inside the drupal directory, we will not be downloading core since that already happened with the git clone and setting the --prepare-install argument will set us up nicely for the drush site installation command, run drush help make to see the details.
    % drush make --no-core --contrib-destination=/profiles/mysite --prepare-install mysite.make
  2. Prepare the database using PHPMyAdmin or similar.
  3. Execute the drush site installation script.
    % drush si mysite --db-url=mysql://test:test@localhost/mysite.test --account-name=test --account-pass=test --site-name=mysite.mysite --site-mail=admin@mysite.mysite

Ta Da! You should be up and running with all your modules, libraries and themes installed.

The Future?

DOG is currently been developed and I'll try it out once it is stable enough.

Dries Buytaert has stated that one of his key initiates will be configuration management so we can expect significant further development in this area.

The recommend follow on tutorial will be migrating your site across to the live server using drush site aliases http://drupal7.tutorial/drupal-7/tutorials/deployment/local-remote-sites-using-drush-site-aliases

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Recent Tweets

  • New post: Posting location co-ordinates to a drupal service - Part 2 2 years 1 month ago
  • New post: Posting location co-ordinates to a drupal service - Part 1 2 years 1 month ago
  • New post: Connecting a drupal service with a mobile application - Part 2 2 years 1 month ago
  • New post: Using drupal services to connect to mobile applications - Part 1 2 years 1 month ago
  • New post: Creating Drupal 7 video gallery 2 years 3 months ago