Installing Drupal8 using Drush7 Make

drush_logo-blackIn the past I’ve covered Drush, Drush Make and recently installing Drush7 for interacting with Drupal8.

This blog post will show 1 way to install Drupal8 using Drush7 Make.

I typically do this with 2 files, a Bash script and a Drush Makefile.

My Bash Script for my project, build.sh:

start_time=`date +%s`

echo "This script will build the project website using Drush Make."
sleep 5

PROJ="/path/to/myProject"
SRC="${PROJ}/source"
BUILD="${PROJ}/src/build"
DIST="${PROJ}/dist"
WWW="${PROJ}/dist/www"
drush="${PROJ}/drush7/drush"
year=`date +%Y`

PATH="$HOME/.composer/vendor/bin:/usr/local/bin:$PATH"

echo "We are using the following version of Drush:"
echo $drush
$drush --version
sleep 15

echo "Clobbering files in ${WWW}."
sudo rm -rfv $WWW
sudo rm  -rfv ${DIST}/*
sleep 5
echo "running drush make file for Project website build."
echo "This will build the website."
$drush --verbose make ./my_website.make ${WWW}/

mkdir -p "${WWW}/sites/default/files"
chmod -R a+rw "${WWW}/sites/default"

echo "Installing Drupal 8 using custom project profile."
cd $WWW
$drush site-install standard \
  --site-mail="helpdesk@test.edu" \
  --locale="en" \
  --db-url="mysql://dev_user:dev@localhost/mysite_drupal8" \
  --account-name="_admin" \
  --account-pass="@dev${year}" \
  --account-mail="test@test.edu" \
  --site-name="MyProject Website" -y

sudo chmod -R a+rw "${WWW}/sites/default/files"

$drush cron -v
$drush cache-rebuild -v

My Drush makefile, my_site.make:

;
; This makefile builds Drupal Core + a custom website/project build makefile.
;

; Core version
; The make file always begins by specifying the core version of Drupal for
; which each package must be compatible.
core = 8.x

; API version
; The make file must specify which Drush Make API version it uses.
api = 2

; Drupal core
; Specific version
;projects[drupal][version] = 8.0

; Head from git
projects[drupal][download][type] = git
projects[drupal][download][url] = http://git.drupal.org/project/drupal.git
projects[drupal][download][branch] = 8.x
projects[drupal][download][tag] = 8.0-alpha9
;projects[drupal][download][revision] =

; Includes
; include other make files from local or remote destinations
; includes[modules] = "modules.make"
; includes[example_relative] = "../example_relative/example_relative.make"
; includes[remote] = "http://www.example.com/remote.make"
includes[development] = "http://localhost:4000/drush-makefiles/development.make"

I then simply call my bash script and Drupal8 is installed to the destination directory using the Standard installation profile.

Some Items of note vs typical Drupal7 usage here:

  • This makefile uses includes[] (https://drupal.org/node/820992). This is a means to use additional local or remote makefiles. This can be a nice way organize your makefile! I typically host local patches, snapshots of 3rd party libraries or Drush makefiles on either PHP 5 builtin server or the Serve rubygem.

  • The bash script uses cache-rebuild, cache-clear or its shorthand “cc” has been deperacted in Drupal 8.

  • In Drupal8, as you develop your own Installation Profile you can then rename Standard in build.sh with the name of your own Profile and you have an installation script you can use with Git and version control of your installation/build procedure.

Looking for quality Drupal Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , , , | Posted under Drupal, Drush | RSS 2.0

Author Spotlight

David Gurba

David Gurba

I am a web programmer currently employed at UCSB. I have been developing web applications professionally for 8+ years now. For the last 5 years I’ve been actively developing websites primarily in PHP using Drupal. I have experience using LAMP and developing data driven websites for clients in aviation, higher education and e-commerce. If you’d like to contact me I can be reached at david.gurba@arvixe.com

Leave a Reply

Your email address will not be published. Required fields are marked *


9 − 4 =

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>