boedah/robo-drush

Drush CommandStack for Robo Task Runner

Installs: 2 619

Dependents: 0

Stars: 6

Watchers: 4

Forks: 2

Open Issues: 1

Language: PHP

2.1.0 2015-02-27 22:28 UTC

README

Extension to execute Drush commands in Robo.

SensioLabsInsight Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Runs Drush commands in stack. You can define global options for all commands (like Drupal root and uri).

The option -y is always set, as it makes sense in a task runner.

Table of contents

Installation

Versions

  • ~1.0: Robo <= 0.4.5
  • ~2.1: Robo >= 0.5.2

Add "boedah/robo-drush": "~2.1" to your composer.json:

    {
        "require-dev": {
            "boedah/robo-drush": "~2.1"
        }
    }

Execute composer update.

Usage

Use the trait (according to your used version) in your RoboFile:

class RoboFile extends \Robo\Tasks
{
    // if you use ~2.1 for Robo ~0.5.2
    use \Boedah\Robo\Task\Drush\loadTasks;

    // if you use ~1.0 for Robo ~0.4
    use \Boedah\Robo\Task\Drush;

    //...
}

Examples

Site update

This executes pending database updates and reverts all features (from code to database):

$this->taskDrushStack()
    ->drupalRootDirectory('/var/www/html/some-site')
    ->uri('sub.example.com')
    ->maintenanceOn()
    ->updateDb()
    ->revertAllFeatures()
    ->maintenanceOff()
    ->run();

Site install

$this->taskDrushStack()
  ->siteName('Site Name')
  ->siteMail('site-mail@example.com')
  ->locale('de')
  ->accountMail('mail@example.com')
  ->accountName('admin')
  ->accountPass('pw')
  ->dbPrefix('drupal_')
  ->sqliteDbUrl('sites/default/.ht.sqlite')
  ->disableUpdateStatusModule()
  ->siteInstall('minimal')
  ->run();