fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] splitting large fabfile.py


From: Jeff Forcier
Subject: Re: [Fab-user] splitting large fabfile.py
Date: Mon, 11 May 2009 09:29:21 -0400

Hi Aljosa,

Unforunately, Fabric 0.1 and older do not support splitting a fabfile
into multiple files, so I'm afraid you're out of luck for the time
being.

Fabric 0.9 is on the way and should support this sort of thing; there
is currently an alpha out (http://fabfile.org), and while I do not
suggest using an alpha or beta for production work, you may want to
try it out in a test environment to get an idea of how the final
product might behave.

0.9's main focus is on allowing code to be plain Python with less
magic, so while I haven't yet tried this approach out, it should be
possible for you to perform imports like in your below example, and
have it "just work".

Best,
Jeff

On Mon, May 11, 2009 at 9:17 AM, Aljosa Mohorovic
<address@hidden> wrote:
> i'm trying to split a large fabfile.py but i can't find any examples
> in docs and there is no info how should i use "config" when "fabric
> actions" are defined in a different file.
> my code looks similar to:
> --------------------------------------------------------------------------
> config.project = 'some project'
> config.[...] # other options
>
> from deploy.something import some_fab_action
>
> def local():
>  "set development env: LOCAL"
>  config.fab_user = 'aljosa'
>  config.fab_hosts = ['localhost',]
>  config.project_root = os.path.abspath('.')
>
> [...]
> --------------------------------------------------------------------------
>
> now when i call "$ fab local some_fab_action" how should i use
> "config" in some_fab_action which is in "deploy.something" and
> imported into fabfile.py?
> any tips/ideas are welcome.
>
> Aljosa Mohorovic
>
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]