For example:
def task(something=''):
print "You said %s" % something
$ fab task "hello"
You said hello
Done.
Fabric:
A library and command line tool for streamlining the use of ssh for application deployment or systems administrationtasksto automate deployments, migrations, execute management commands, monitoringno more repetitive maintenance task done manually
- Fabric uses the following syntax for passing arguments to tasks:
-
fab task:'hello world' fab task:something='hello'fab task:foo=99,bar=Truefab task:foo,barYou need to pass all Python variables as strings, especially if you are using sub-process to run the scripts, or you will get an error. You will need to convert the variables back to int/Boolean types separately.def print_this(var): print str(var) fab print_this:'hello world' fab print_this='hello' fab print_this:'99' fab print_this='True'
No comments:
Post a Comment