forked from uwdub/web-dub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
25 lines (20 loc) · 755 Bytes
/
tasks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import importlib
import invoke
task_module_names = [
'base.invoke.tasks.calendar',
'base.invoke.tasks.compile',
'base.invoke.tasks.docker',
'base.invoke.tasks.jekyll',
'base.invoke.tasks.update',
]
# Create our task collection
tasks = invoke.Collection()
# Populate it with the tasks in each module
for module_name_current in task_module_names:
module_loaded = importlib.import_module(module_name_current)
# Add each task from that module
module_collection = invoke.Collection.from_module(module_loaded)
for task_name_current in module_collection.task_names.keys():
tasks.add_task(module_collection[task_name_current], task_name_current)
# Invoke expects the default collection to be named 'ns'
ns = tasks