Skip to content

Instantly share code, notes, and snippets.

@Greg-Boggs
Forked from wxactly/RoboFile.php
Created January 28, 2016 17:03
Show Gist options
  • Save Greg-Boggs/df4014cca04aabd74c31 to your computer and use it in GitHub Desktop.
Save Greg-Boggs/df4014cca04aabd74c31 to your computer and use it in GitHub Desktop.
ThinkShout/Cascade RoboFile
<?php
/**
* This is project's console commands configuration for Robo task runner. fork
*
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks
{
/**
* Run Drupal tests.
*
* @param string $group
* One or more tests to be run. By default, these are interpreted
* as the names of test groups. Tests must be separated by commas.
*
* @return \Robo\Result
*/
public function test($group = 'Cascade') {
return $this->taskExec('php')
->arg('public/scripts/run-tests.sh')
->arg($group)
->run();
}
/**
* Clean Drupal tests.
*
* @return \Robo\Result
*/
public function testClean() {
return $this->taskExec('php')
->arg('public/scripts/run-tests.sh')
->arg('--clean')
->run();
}
/**
* Cascade ts dev scaffold process for converting a live database.
*
* @return \Robo\Result
*/
public function scaffold() {
$tasks[] = $this->taskGitStack()
->checkout('ts_dev_scaffold');
$tasks[] = $this->taskExecStack()
->stopOnFail()
->exec('drush rr')
->exec('drush updb -y');
$tasks[] = $this->taskGitStack()
->checkout('ts_dev');
$tasks[] = $this->taskExecStack()
->stopOnFail()
->exec('drush rr')
->exec('drush updb -y')
->exec('drush fra -y');
foreach ($tasks as $task) {
$result = $task->run();
if (!$result->wasSuccessful()) {
return $result;
}
}
return Robo\Result::success($this, 'ts dev scaffold success');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment