{"id":18594554,"url":"https://github.com/openeuropa/task-runner","last_synced_at":"2025-08-26T02:07:15.862Z","repository":{"id":27681624,"uuid":"114144946","full_name":"openeuropa/task-runner","owner":"openeuropa","description":"PHP task runner based on Robo, focused on extensibility. ","archived":false,"fork":false,"pushed_at":"2025-07-23T14:33:01.000Z","size":540,"stargazers_count":37,"open_issues_count":1,"forks_count":11,"subscribers_count":29,"default_branch":"2.x","last_synced_at":"2025-08-21T08:06:20.903Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openeuropa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-13T16:40:13.000Z","updated_at":"2025-07-23T14:33:03.000Z","dependencies_parsed_at":"2024-01-14T09:18:15.240Z","dependency_job_id":"aaa6890a-0e83-4f3b-8bcd-9d7396181d7d","html_url":"https://github.com/openeuropa/task-runner","commit_stats":{"total_commits":337,"total_committers":21,"mean_commits":"16.047619047619047","dds":0.6083086053412463,"last_synced_commit":"226ff3d6e2fda264bad984a113bb9dbc97c74b68"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/openeuropa/task-runner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openeuropa%2Ftask-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openeuropa%2Ftask-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openeuropa%2Ftask-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openeuropa%2Ftask-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openeuropa","download_url":"https://codeload.github.com/openeuropa/task-runner/tar.gz/refs/heads/2.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openeuropa%2Ftask-runner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272160241,"owners_count":24883779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T01:16:10.633Z","updated_at":"2025-08-26T02:07:15.831Z","avatar_url":"https://github.com/openeuropa.png","language":"PHP","funding_links":[],"categories":["Scripts"],"sub_categories":["Robofile"],"readme":"# Task Runner\n[![Build Status](https://drone.fpfis.eu/api/badges/openeuropa/task-runner/status.svg)](https://drone.fpfis.eu/openeuropa/task-runner)\n[![Packagist](https://img.shields.io/packagist/v/openeuropa/task-runner.svg)](https://packagist.org/packages/openeuropa/task-runner)\n\nPHP task runner based on [Robo](http://robo.li), focused on extensibility.\n\nQuick references:\n\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Built-in commands](#built-in-commands)\n- [Expose custom commands as YAML configuration](#expose-custom-commands-as-yaml-configuration)\n- [Expose custom commands as PHP classes](#expose-custom-commands-as-php-classes)\n\n## Installation\n\nInstall it with [Composer](https://getcomposer.org):\n\n```bash\ncomposer require openeuropa/task-runner\n```\n\nAfter installation run `./vendor/bin/run` for a list of available commands.\n\n### Using Docker Compose\n\nAlternatively, you can build a development site using [Docker](https://www.docker.com/get-docker) and\n[Docker Compose](https://docs.docker.com/compose/) with the provided configuration.\n\nDocker provides the necessary services and tools to get the tests running, regardless of your local host configuration.\n\n#### Requirements:\n\n- [Docker](https://www.docker.com/get-docker)\n- [Docker Compose](https://docs.docker.com/compose/)\n\n#### Configuration\n\nBy default, Docker Compose reads two files, a `docker-compose.yml` and an optional `docker-compose.override.yml` file.\nBy convention, the `docker-compose.yml` contains your base configuration and it's provided by default.\nThe override file, as its name implies, can contain configuration overrides for existing services or entirely new\nservices.\nIf a service is defined in both files, Docker Compose merges the configurations.\n\nFind more information on Docker Compose extension mechanism on [the official Docker Compose documentation](https://docs.docker.com/compose/extends/).\n\n#### Usage\n\nTo start, run:\n\n```bash\ndocker-compose up\n```\n\nIt's advised to not daemonize `docker-compose` so you can turn it off (`CTRL+C`) quickly when you're done working.\nHowever, if you'd like to daemonize it, you have to add the flag `-d`:\n\n```bash\ndocker-compose up -d\n```\n\nThen:\n\n```bash\ndocker-compose exec web composer install\n```\n\n#### Running the tests\n\nTo run the grumphp checks:\n\n```bash\ndocker-compose exec web ./vendor/bin/grumphp run\n```\n\nTo run the phpunit tests:\n\n```bash\ndocker-compose exec web ./vendor/bin/phpunit\n```\n\n## Configuration\n\nTask Runner provides a useful command (`config`) that allows inspecting and\ndebugging the configuration. To find out how can be used, run:\n\n```bash\n./vendor/bin/run config --help\n```\n\nTask Runner commands can be customized in two ways:\n\n1. By setting arguments and options when running a command.\n2. By providing default values in configuration files. The task runner will read\n   the following files in the specified order. Options supplied in later files\n   will override earlier ones:\n    * The defaults provided by Task Runner. This file is located inside the Task\n      Runner repository in `config/runner.yml`.\n    * `runner.yml.dist` - project specific defaults. This file should be placed\n      in the root folder of the project that depends on the Task Runner. Use\n      this file to declare default options which are expected to work with your\n      application under regular circumstances. This file should be committed in\n      the project.\n    * Third parties might implement config providers to modify the config. A\n      config provider is a class implementing the `ConfigProviderInterface`.\n      Such a class should be placed under the `TaskRunner\\ConfigProviders`\n      relative namespace. For instance when `Some\\Namespace` points to `src/`\n      directory, then the config provider class should be placed under the\n      `src/TaskRunner/ConfigProviders` directory and will have the namespace set\n      to `Some\\Namespace\\TaskRunner\\ConfigProviders`. The class name should end\n      with the `ConfigProvider` suffix. Use the `::provide()` method to alter\n      the configuration object. A `@priority` annotation tag can be defined in\n      the class docblock in order to determine the order in which the config\n      providers are running. If omitted, `@priority 0` is assumed. This\n      mechanism allows also to insert custom YAML config files in the flow, see\n      the following example:\n      ```\n      namespace Some\\Namespace\\TaskRunner\\ConfigProviders;\n\n      use OpenEuropa\\TaskRunner\\Contract\\ConfigProviderInterface;\n      use OpenEuropa\\TaskRunner\\Traits\\ConfigFromFilesTrait;\n      use Robo\\Config\\Config;\n\n      /**\n       * @priority 100\n       */\n      class AddCustomFileConfigProvider implements ConfigProviderInterface\n      {\n          use ConfigFromFilesTrait;\n          public static function provide(Config $config): void\n          {\n              // Load the configuration from custom.yml and custom2.yml and\n              // apply it to the configuration object. This will override config\n              // from runner.yml.dist (which has priority 1500) but get\n              // overridden by the config from runner.yml (priority -1000).\n              static::importFromFiles($config, [\n                  'custom.yml',\n                  'custom2.yml',\n              ]);\n          }\n      }\n      ```\n    * `runner.yml` - project specific user overrides. This file is also located\n      in the root folder of the project that depends on the Task Runner. This\n      file can be used to override options with values that are specific to the\n      user's local environment. It is considered good practice to add this file\n      to `.gitignore` to prevent `runner.yml` from being accidentally committed\n      in the project repository.\n    * User provided global overrides stored in environment variables. These can\n      be used to define environment specific configuration that applies to all\n      projects that use the Task Runner, such as database credentials and the\n      Github access token. The following locations will be checked and the first\n      one that is found will be used:\n        * `$OPENEUROPA_TASKRUNNER_CONFIG`\n        * `$XDG_CONFIG_HOME/openeuropa/taskrunner/runner.yml`\n        * `$HOME/.config/openeuropa/taskrunner/runner.yml`\n\n- [Installation](#installation)\n\nA list of default values, with a brief explanation, can be found at the default\n[`runner.yml`](./config/runner.yml).\n\n\n## Built-in commands\n\nThe Task Runner comes with the following built-in commands:\n\n| Command                      | Description |\n| ---------------------------- |-------------|\n| `changelog:generate`         | Generate a changelog for the current project based on its GitHub issues and pull requests |\n| `drupal:site-install`        | Install a target Drupal site using default configuration values and/or CLI options |\n| `drupal:site-pre-install`    | Run Drupal pre-install commands as listed under the `drupal.pre_install` property |\n| `drupal:site-post-install`   | Run Drupal post-install commands as listed under the `drupal.post_install` property |\n| `drupal:settings-setup`      | Setup default Drupal settings file by appending values specified at `drupal.settings` |\n| `drupal:drush-setup`         | Setup Drush 8 and 9 configuration files |\n| `release:create-archive`     | Create and archive a release for the current project |\n\nRun `./vendor/bin/run help [command-name]` for more information about each command's capabilities.\n\n## Expose \"dynamic\" commands as YAML configuration\n\nThe Task Runner allows you to expose new commands by just listing its [tasks](http://robo.li/getting-started/#tasks)\nunder the `commands:` property in `runner.yml.dist`/`runner.yml`.\n\nFor example, the following YAML portion will expose two dynamic commands, `drupal:site-setup` and `setup:behat`:\n\n```yaml\ncommands:\n  drupal:site-setup:\n    - { task: \"chmod\", file: \"${drupal.root}/sites\", permissions: 0774, recursive: true }\n    - { task: \"symlink\", from: \"../../custom/modules\", to: \"${drupal.root}/modules/custom\" }\n    - { task: \"symlink\", from: \"../../custom/themes\", to: \"${drupal.root}/themes/custom\" }\n    - { task: \"run\", command: \"drupal:drush-setup\" }\n    - { task: \"run\", command: \"drupal:settings-setup\" }\n    - { task: \"run\", command: \"setup:behat\" }\n    - \"./vendor/bin/drush --root=$(pwd)/${drupal.root} cr\"\n  setup:behat:\n    - { task: \"process\", source: \"behat.yml.dist\", destination: \"behat.yml\" }\n```\n\nCommands can reference each-other, allowing for complex scenarios to be implemented with relative ease.\n\nAt the moment the following tasks are supported (optional argument default values in parenthesis):\n\n| Task          | Task                         | Arguments |\n| ------------- | ---------------------------- | --------- |\n| `mkdir`       | `taskFilesystemStack()`      | `dir`, `mode` (0777) |\n| `touch`       | `taskFilesystemStack()`      | `file`, `time` (current time), `atime` (current time) |\n| `copy`        | `taskFilesystemStack()`      | `from`, `to`, `force` (false) |\n| `chmod`       | `taskFilesystemStack()`      | `file`, `permissions`, `umask` (0000), `recursive` (false) |\n| `chgrp`       | `taskFilesystemStack()`      | `file`, `group`, `recursive` (false) |\n| `chown`       | `taskFilesystemStack()`      | `file`, `user`, `recursive` (false) |\n| `remove`      | `taskFilesystemStack()`      | `file` |\n| `rename`      | `taskFilesystemStack()`      | `from`, `to`, `force` (false) |\n| `symlink`     | `taskFilesystemStack()`      | `from`, `to`, `copyOnWindows` (false) |\n| `mirror`      | `taskFilesystemStack()`      | `from`, `to` |\n| `process`     | `taskProcessConfigFile()`    | `from`, `to` |\n| `process-php` | `taskAppendConfiguration()`  | `type: append`, `config`, `source`, `destination`, `override` (false) |\n| `process-php` | `taskPrependConfiguration()` | `type: prepend`, `config`, `source`, `destination`, `override` (false) |\n| `process-php` | `taskWriteConfiguration()`   | `type: write`, `config`, `source`, `destination`, `override` (false) |\n| `run`         | `taskExec()`                 | `command`, `arguments`, `options` (will run `./vendor/bin/run [command] [argument1] [argument2] ... --[option1]=[value1] --[option2]=[value2] ...`) |\n\nTasks provided as plain-text strings will be executed as is in the current working directory.\n\n## Expose custom commands as PHP classes\n\nMore complex commands can be provided by creating Task Runner command classes within your project's PSR-4 namespace.\n\nFor example, given you have the following PSR-4 namespace in your `composer.json`:\n\n```json\n{\n    \"autoload\": {\n        \"psr-4\": {\n            \"My\\\\Project\\\\\": \"./src/\"\n        }\n    }\n}\n```\n\nThen you can expose extra commands by creating one or more classes under `./src/TaskRunner/Commands`, as shown in the\nexample below:\n\n```php\n\u003c?php\n\nnamespace My\\Project\\TaskRunner\\Commands;\n\nuse OpenEuropa\\TaskRunner\\Commands\\AbstractCommands;\n\n/**\n * Class MyCustomCommands\n *\n * @package My\\Project\\TaskRunner\\Commands\n */\nclass MyCustomCommands extends AbstractCommands\n{\n    /**\n     * @command my-project:command-one\n     */\n    public function commandOne() { }\n\n    /**\n     * @command my-project:command-two\n     */\n    public function commandTwo() { }\n}\n```\n\nAfter doing that remember to refresh your local autoloader by running `composer dump-autoload`.\n\nYou can now access your new commands via the Task Runner main executable:\n\n```bash\n$ ./vendor/bin/run\nOpenEuropa Task Runner\n\nAvailable commands:\n ...\n my-project\n  my-project:command-four\n  my-project:command-one\n```\n\n**NOTE:** It is mandatory to place your command classes under `./src/TaskRunner/Commands`, otherwise the Task Runner will not\nregister them at startup.\n\nEven if not mandatory it is recommended for your command classes to extend `OpenEuropa\\TaskRunner\\Commands\\AbstractCommands`.\n\nFor more details on how to expose custom commands please refer to the main [Robo documentation](http://robo.li/getting-started).\n\n## Contributing\n\nPlease read [the full documentation](https://github.com/openeuropa/openeuropa) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the available versions, see the [tags on this repository](https://github.com/openeuropa/task-runner/tags).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopeneuropa%2Ftask-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopeneuropa%2Ftask-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopeneuropa%2Ftask-runner/lists"}