Drush

From Things and Stuff Wiki
Revision as of 02:44, 10 November 2012 by Milk (talk | contribs) (→‎Deployment)
Jump to navigation Jump to search


Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.

Installation

pear channel-discover pear.drush.org
pear install drush/drush

Commands

drush help
  alll the commands!
drush help --filter
  choose which help category to echo

drush pml
  list installed and enabled modules

drush dl [project]
  download project
drush dl sasson-7.x-3.x-dev
  download sasson dev release
drush updb
  run upgrade.php
drush en [project] -y
  enable project without confirmation

drush dis [project] -y
  disable project

drush pm-uninstall [project]
  remove project from db
 
drush cc
  clear caches
drush php-eval 'echo drush_get_context("DRUSH_DRUPAL_ROOT");'
drush php-eval 'echo drush_locate_root() . "/" . drupal_get_path('theme', 'sasson');'

drush eval 'echo theme_get_setting('sasson_compiler') . "\n" ;'
  otherwise gives trailing issue?

Aliases

Make

Drush Make is part of Drush as of Jan 2012.

.make files specify a recipe for modules, themes and libraries to be downloaded by Drush.

Examples

projects[drupal][version]  = "7.16"
projects[drupal][patch][]  = "http://drupal.org/files/1356276-base-profile-d7-39-do-not-test.patch"
projects[sasson][type] = theme
projects[sasson][version] = 3.x-dev
projects[sasson][download][type] = git
projects[sasson][download][url] = http://git.drupal.org/project/sasson.git

Libraries

.make files can specify external libraries to be downloaded using the Libraries API module.

; CKEditor
libraries[ckeditor][download][type]= "get"
libraries[ckeditor][download][url] =  "[ckeditor zip url goes here]"
libraries[ckeditor][directory_name] = "ckeditor"
libraries[ckeditor][destination] = "libraries"

Git

You can get things from git, specify branches, etc.

Also;

Deployment

drush help site-alias
drush help rsync
drush help sql-sync

Other