-
-
Save Greg-Boggs/df4014cca04aabd74c31 to your computer and use it in GitHub Desktop.
ThinkShout/Cascade RoboFile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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