consolidation/robo
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
consolidation/annotated-command | 4.10.0 | - | MIT | prod | |
consolidation/config | 2.1.2 | 39.41 kB | MIT | prod | |
consolidation/log | 3.1.0 | - | MIT | prod | |
consolidation/output-formatters | 4.5.0 | 91.97 kB | MIT | prod | |
consolidation/self-update | 2.2.0 | 12.24 kB | MIT | prod | |
league/container | 4.2.2 | - | MIT | prod | |
symfony/console | v6.4.7 | - | MIT | prod dev | |
symfony/event-dispatcher | v6.4.7 | - | MIT | prod dev | |
symfony/filesystem | v6.4.7 | - | MIT | prod dev | |
symfony/finder | v6.4.7 | - | MIT | prod | |
symfony/process | v6.4.7 | - | MIT | prod dev | |
symfony/yaml | v6.4.7 | - | MIT | prod dev |
Consolidation/Robo is a modern, simple PHP task runner that is inspired by Gulp and Rake. Designed to automate common tasks, it allows for writing cross-platform scripts, processing assets such as less, sass, and minification. It also supports running tests, executing daemons and workers, watching filesystem changes, and deployment with sftp/ssh/docker.
To use Consolidation/Robo, you can install it via Phar or Composer. For Phar, you download the robo.phar file and place it in your /usr/bin
directory (or /usr/local/bin
on OSX 10.11+). For Composer, you can run composer require consolidation/robo:^4
and execute Robo tasks with vendor/bin/robo
.
For example usage, you define tasks in the RoboFile.php
, which can be created by running robo init
. All public methods in RoboFile.php
are tasks. You can also run pre-defined tasks that start with the task
prefix and are located in traits.
Here are a few code examples:
To run an acceptance test with a local server and a Selenium server, you can use the following code:
use Robo\Symfony\ConsoleIO;
class RoboFile extends \Robo\Tasks {
function testAcceptance(ConsoleIO $io, $seleniumPath = '~/selenium-server-standalone-2.39.0.jar') {
// Launch PHP server on port 8000 for web dir
// Server will execute in background and stop in the end
$this->collectionBuilder($io)->taskServer(8000)->background()->dir('web')->run();
// Run Selenium server in background
$this->collectionBuilder($io)->taskExec('java -jar ' . $seleniumPath)->background()->run();
// Load Symfony Command and run with passed argument
$this->collectionBuilder($io)->taskSymfonyCommand(new \Codeception\Command\Run('run'))->arg('suite','acceptance')->run();
}
}
You can watch for changes in your composer.json
file and execute composer update
when changes occur:
class RoboFile extends \Robo\Tasks {
function watchComposer(ConsoleIO $io) {
$this->collectionBuilder($io)->taskWatch()->monitor('composer.json', function() use ($io) {
$this->collectionBuilder($io)->taskComposerUpdate()->run();
})->run();
}
}
Consolidation/Robo's documentation is mainly located on its GitHub page. This features its README file sourced directly from the repository which provides an overview of the package, its installation process, usage examples, and more. For more detailed information and examples, you can check out its RoboFile.php
files in the repository or from the Codeception project.