Drupalcamp 2010 Drush Presntation

26
Command Line Drupal February, 2010 Drush Andrew Riley

description

 

Transcript of Drupalcamp 2010 Drush Presntation

Page 1: Drupalcamp 2010 Drush Presntation

Command Line Drupal

February, 2010

DrushAndrew Riley

Page 2: Drupalcamp 2010 Drush Presntation

What is Drush?

Page 3: Drupalcamp 2010 Drush Presntation

Yes, it allows you to manipulate Drupal

without ever having to go into Drupal.

Shh, it works in windows too.

Drupal Shell

Page 4: Drupalcamp 2010 Drush Presntation

Who should use it?

Page 5: Drupalcamp 2010 Drush Presntation

Module DevelopersTheme DevelopersSite DevelopersPeople who don’t call themselves developers*

Developers

Page 6: Drupalcamp 2010 Drush Presntation

DeploymentDevelopers

Ongoing

Page 7: Drupalcamp 2010 Drush Presntation

Don’t need DrushThey can use normal DrupalThey will be envious

Content Managers

Page 8: Drupalcamp 2010 Drush Presntation

Why use it?

Page 9: Drupalcamp 2010 Drush Presntation

SpeedNormal: 5 StepsDrush: 2 Steps

200 Steps?1

Page 10: Drupalcamp 2010 Drush Presntation

ConsistancyThings are better when humans aren’t involved.2

Page 11: Drupalcamp 2010 Drush Presntation

Should you add modules in : /sites/all/modules (Possible)

/sites/default/modules (Possible) /modules (HECK NO)

Page 12: Drupalcamp 2010 Drush Presntation

It’s scriptable3

Page 13: Drupalcamp 2010 Drush Presntation

#!/usr/bin/sh rm ~/update_backup.sql.gzdrush sql dump | gzip > ~/update_backup.sql.gzdrush updatedrush cc

Page 14: Drupalcamp 2010 Drush Presntation

How to use it

Page 15: Drupalcamp 2010 Drush Presntation

Installing is easy -follow the directions

Page 16: Drupalcamp 2010 Drush Presntation

Increase your memory_limitin php.ini

Page 17: Drupalcamp 2010 Drush Presntation

drush help

HELP ME!!!!

Page 18: Drupalcamp 2010 Drush Presntation

drush download {modulename}

or

drush dl {modulename}

Example: drush download webform

Downloading

Page 19: Drupalcamp 2010 Drush Presntation

drush cache clear

or

drush cc

Clear Cache

Page 20: Drupalcamp 2010 Drush Presntation

drush cron

Run Cron

Page 21: Drupalcamp 2010 Drush Presntation

drush update

Updates your code base and runs the database update.

Updating Drupal

Page 22: Drupalcamp 2010 Drush Presntation

drush sql dump

or

drush sql dump | gzip > ~/update_backup.sql.gz

Backup your DB

Page 23: Drupalcamp 2010 Drush Presntation

drush sql load

Restore your DB

Page 24: Drupalcamp 2010 Drush Presntation

drush variable get {name}

drush variable set {name} {value}

Variable Set/Get

Page 25: Drupalcamp 2010 Drush Presntation

Modules can expand it (xmlsitemap2, sitedir_migrate, backup_migrate)

There are modules that only work with Drush (Drush Make, etc)

Extending Drush

Page 26: Drupalcamp 2010 Drush Presntation

Questions?

Andrew Riley

Associate Director of Software Development

@andrewmriley

Mindcomet