Extension to execute Drush commands in Robo.
Runs Drush commands in stack. You can define global options for all commands (like Drupal root and uri).
The option -y assumed by default but can be overridden on calls to exec()
by passing false
as the second parameter.
~1.0
: Robo <= 0.4.5~2.1
: Robo >= 0.5.2~3.0
: Robo >= 1.0.0-RC1
Add "boedah/robo-drush": "~3"
to your composer.json:
{
"require-dev": {
"boedah/robo-drush": "~3"
}
}
Execute composer update
.
composer test
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, or ~3 for Robo >=1.0.0-RC1
use \Boedah\Robo\Task\Drush\loadTasks;
// if you use ~1.0 for Robo ~0.4
use \Boedah\Robo\Task\Drush;
//...
}
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();
$this->taskDrushStack()
->siteName('Site Name')
->siteMail('[email protected]')
->locale('de')
->accountMail('[email protected]')
->accountName('admin')
->accountPass('pw')
->dbPrefix('drupal_')
->sqliteDbUrl('sites/default/.ht.sqlite')
->disableUpdateStatusModule()
->siteInstall('minimal')
->run();