[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fab-user] Can Fabric have (simple) multi-server wrapper tasks?
From: |
Carlton Gibson |
Subject: |
[Fab-user] Can Fabric have (simple) multi-server wrapper tasks? |
Date: |
Wed, 2 Feb 2011 11:41:14 +0000 |
Hi All,
I'm using Fabric to manage a fairly standard (?) Django deployment. We have
front end web server which handles static media and proxies to a pair of
application servers.
Updating the application is fairly simple but it involves a sequence of steps
across the different servers. For this we use roles, via the decorators, which
works perfectly but we end up with a long command string:
$ fab run_tests freeze_requirements update_repository create_snapshot
update_virtualenv update_media update_nginx graceful_migrate
What I want here is to wrap this in a single task so I can just call:
$ fab deploy
As you see coming, the trouble is that the @role decorators aren't evaluated
within the deploy task, so this approach fails. It's easy enough to wrap in a
shell script, but that's outside the fabfile. Otherwise there's the ugly option
of manually munging env.host_string with the deploy task.
1. Is there another way I'm missing? (Quite possibly :-)
2. Would it be feasible to able a command line option to say, "get your list of
tasks from here", which would address this use-case?
Regards,
Carlton
- [Fab-user] Can Fabric have (simple) multi-server wrapper tasks?,
Carlton Gibson <=