Reputation: 2343
How can I define dependencies between tasks correctly using Fabric?
Given the following fabfile.py
:
from fabric.tasks import task
@task
def clean(c):
print(type(c))
@task(pre=[clean])
def deploy(c):
print(type(c))
Running this fabfile.py
using fab2
results in:
$ fab2 -H example.org deploy
<class 'invoke.context.Context'>
<class 'fabric2.connection.Connection'>
Why is the the first argument to the clean
task different from the first argument to deploy
? I would have expected that a fabric2.connection.Connection
instance is passed to each of them.
How would I run commands remotely in clean
?
Upvotes: 1
Views: 593