pyinvoke / invoke

Pythonic task management & command execution.
http://pyinvoke.org
BSD 2-Clause "Simplified" License
4.41k stars 369 forks source link

Specify a config file per Collection... possible? #978

Open jamiebullock opened 11 months ago

jamiebullock commented 11 months ago

I would like to be able to define a set of tasks, and then load those tasks into multiple collections, each with a separate configuration.

Something like this:

tasks
├── __init__.py
├── config_a.yaml
├── config_b.yaml
└── stuff.py

And in the __init__.py

from invoke import Collection
import tasks.stuff

ns = Collection()
ns.add_collection(stuff, 'A')
ns.add_collection(stuff, 'B')

How do I make the 'A' collection use config_a.yaml and 'B' use config_b.yaml?