Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPENEUROPA-372: Allow custom commands to define options #44

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

OPENEUROPA-372: Allow custom commands to define options #44

wants to merge 3 commits into from

Conversation

claudiu-cristea
Copy link
Contributor

@claudiu-cristea claudiu-cristea commented Feb 12, 2018

Problem

As the README states, the runner config can be controlled either by arguments and options passed on the command line or by configuring the values in the runner.yml.dist and runner.yml files. However, passing options to the command line is true for regular annotated commands. But this library introduces the concept of dynamic commands. And for such commands there's no way to define run-time options. How to override in CI a specific config value for the drupal:site-setup, for instance, which is defined dynamically?

Proposal

TL;DR Allow options that can be bound to config entries for custom commands.

Allow defining options for custom commands. Such options could be bound to a specific config entry to overwrite it. See the README and the test added in this PR for details.

Also, custom commands that have subsequent tasks, are exposing also their options, so that calling a custom command with options, when is executed, will pass the options to subsequent tasks.

@ademarco
Copy link
Member

@claudiu-cristea we have opened an issue about this on our board.

@ademarco ademarco changed the title Allow config overriding from command line OPENEUROPA-372: Allow config overriding from command line Mar 12, 2018
@claudiu-cristea claudiu-cristea changed the title OPENEUROPA-372: Allow config overriding from command line OPENEUROPA-372: Allow custom commands to define options Mar 25, 2018
@claudiu-cristea
Copy link
Contributor Author

claudiu-cristea commented Mar 25, 2018

@ademarco, I changed the scope of this issue. Defining custom commands options is just enough to achieve the CI problem. Also, now if you define a custom command, it will inherit the command options from the children commands and when you run that commands the options will propagate down, to the children command.

- A custom command that runs other commands as task will inherit their options.
- Input options passed to a custom command are propagating to sub-tasks.
@ademarco
Copy link
Member

ademarco commented Jul 2, 2018

@claudiu-cristea this is a very interesting addition, would you maybe have time to rebase it on the latest change?

geek-merlin pushed a commit to geeks4change/task-runner that referenced this pull request Nov 11, 2021
@geek-merlin
Copy link

Rebased #157 now worksforme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants