Feature/interactively invoke custom tasks #264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently working with custom tasks from the cli is difficult. It's not necessarily clear to the user, when running a custom task, which task they need to run (i.e. its name) or what arguments to pass it.
PR #262 addresses the case where name and argument lists are known, and could be used in scripts, CI/CD pipelines, etc. BUT for the standard user of Lagoon who just wants to run a custom task from the cli, it doesn't help.
What this PR does is introduce an interactive task run mode that is analogous to the UIs task list.
When running
lagoon run task interactive -p projectname -e environmentnamethe CLI will get a list of all custom tasks registered to the environment and display it as a select prompt.Once the user selects which task they would like to run, if there are any arguments, the user is presented with either a select prompt (for arguments with ranges of values to select from) or are given the opportunity to type in text.
Finally, the user will be presented with an opportunity to confirm or cancel whether they want to run the command against the target.
Checklist
Changelog Entry
Feature - Adds interactive set of prompts to run custom tasks.