boedah/robo-drush

Drush CommandStack for Robo Task Runner

Installs: 343 925

Dependents: 6

Suggesters: 0

Security: 0

Stars: 22

Watchers: 5

Forks: 19

Open Issues: 4

Type:robo-tasks

pkg:composer/boedah/robo-drush

5.0.0 2026-02-05 16:51 UTC

README

Extension to execute Drush commands in Robo.

Latest Stable Version Total Downloads PHP Version Require

PHP tests License

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

The option -y is assumed by default but can be overridden on calls to exec() by passing false as the second parameter.

Table of contents

Installation

composer require --dev boedah/robo-drush

Testing

composer test

Usage

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

class RoboFile extends \Robo\Tasks
{
    use \Boedah\Robo\Task\Drush\Tasks;
}

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();