Drupal Tools – Drush



Drupal Tools – Drush

0 0


jeremypeter.github.io


On Github jeremypeter / jeremypeter.github.io

Drupal Tools

Drush

http://www.drush.org/en/master/

Command line tool for interacting with Drupal. It can install, enable, disable modules/themes/profiles.

Example commands

# Clears all cache
drush cc all

# Clears specific cache
drush cc menu

# List modules
drush pm-list

# Download a module
drush dl <module_name>

# Enable or disable a module
drush en <module_name>
drush dis <module_name>

Drush make

http://www.drush.org/en/master/make/

An extension of drush which allows you take a config file and build your Drupal distribution/site around those configs.

  • Downloading Drupal core from drupal.org
  • Checking code out from git repositories
  • Getting plain .tar.gz and .zip files
  • Fetching and applying patches
  • Fetching modules, themes

Example config

# The Drush Make API version. This should always be 2.
api = 2

# The version of Drupal the profile is built for. 
core = 7.x

# The projects attribute is where you define the modules/themes that
# are to be packaged with the profile.
projects:
  drupal:
    version: 7.33

projects:
  views:
    version: 2.8

Command to run

# Build Drupal site at example/ path
drush make config.make.yml example/

Grunt Drupal Tasks

https://github.com/phase2/grunt-drupal-tasks

Grunt plugin for common Drupal build and testing tasks

Benefits

  • Support Drupal 7 & 8
  • Verifies code quality
  • Run tests
  • Project scaffolding
  • Can add your own custom configuration
  • Does require installation of Bundler, Composer, Ruby, and RubyGems

Example commands

# Run PHP Lint and PHP Code Snifer
grunt validate

# Uses Compass to compile SASS files  
grunt compile-theme

# Run local server using drush
grunt drush:runserver

# Run tests with Drupal Behat extension
grunt test