fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Fabric parameter to load fabfile.py recursive (up in fol


From: Jeff Forcier
Subject: Re: [Fab-user] Fabric parameter to load fabfile.py recursive (up in folders)
Date: Wed, 30 Dec 2009 13:58:53 -0500

Hi all,

I've updated http://code.fabfile.org/issues/show/122 since it seemed
relevant to this discussion.

The most obvious solution seems to be to make ~/.fabricrc a full
fabfile of sorts and to simply process it prior to loading the "main"
(per-project / based on user's cwd) fabfile. (Or leave it alone and
additionally auto-search for a ~/.fabfile.py or similar.)

We could also change the logic so it no longer stops at the first
fabfile but searches up to filesystem root and loads all found
fabfiles in reverse order (so the "closest" fabfile overrides "farther
away" ones.) This sounds closer to what Domen wants, and is possibly
cleaner than the "home dir + local" approach in the previous
paragraph.

(Steve, is your .fabrc solution different from either of those? is it
documented anywhere? I don't recall seeing it previously...)

The major problem with any multiple-fabfile approach, however, is that
it can break the ability to understand a given fabfile just by reading
it, because -- once http://code.fabfile.org/issues/show/21 is
implemented to allow calling of tasks by name -- the internal mapping
of task names/objects will have >1 fabfiles' worth of tasks in it.

This makes me kind of uncomfortable, though I realize how useful it
could still be. It's one of those things where I have to balance
"magical" usefulness against "non-surprising" naivite.

Thoughts welcome :)

-Jeff

On Wed, Dec 30, 2009 at 11:04 AM, Steve Steiner (listsin)
<address@hidden> wrote:
>
> On Dec 30, 2009, at 10:48 AM, Domen Kožar wrote:
>> Current solution:
>> Import my "global project fabfile" from /home/user/code/fabfile.py in
>> every project.
>
> I do the same thing, only from a ~/.fabrc directory (or something like that, 
> I forget).  I remember there was some talk about adding this but I didn't pay 
> much attention because I had already implemented my own solution.
>
> I'm not sure I like the magic up-traversal idea at all; even one level up 
> things have no relation to where I start and, especially on our servers, up 
> is not even an option from the jailed shell.  The highest level you'd reach 
> would be ~ anyway and the .fabrc solution already handles that.
>
> S
>
>
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>



-- 
Jeff Forcier
Unix sysadmin; Python/Ruby developer
http://bitprophet.org




reply via email to

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