Execute tasks inside another tasks

Open
#884 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
cli

Research direction

Start with the task function and context.run example in the issue, then review Invoke's task-execution entry points and existing guidance for nested tasks. Confirm whether conditional task execution is already supported or requires a new capability; done should include a documented, tested answer for the requested usage.

Written by the indexing model from the issue text.

Description

Is there a way to execute a task inside another tasks. For instance, I have something like

@task
def my_task(context, param_one=False, param_two=True):
    if param_one:
    # Execute a tasks here 

    if param_two:
    # execute a task here

    context.run('execute some other stuff in here'))

I need to execute one of the tasks based on the parameters provided, any advice is more than welcome ,thanks in advanced

Dominant language
Python
Stars
4.8k
Forks
412
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pyinvoke/invoke

All issues in pyinvoke/invoke

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.